HomeComputer ScienceMain Thread vs. Background Pool: Frame Budget Simulator

Main Thread vs. Background Pool: Frame Budget Simulator

Route simulated mobile-app tasks onto the UI thread or a background worker pool and watch frame drops, jank and pool utilization respond in real time under the 16.67ms frame-budget model.

Computer Science3DModerate60 FPS📱 Mobile-adapted⇄ 2D version
mobile-threading-concurrency ↗ Open standalone

Every mobile app balances the same trade-off: work done on the UI thread blocks the next frame, while work handed to a background thread pool runs in parallel without ever touching the screen. This simulator generates a stream of tasks with a configurable cost and spawn rate, lets you route them to either a single main (UI) thread lane or a resizable worker pool, and renders both as real 3D lanes where queued tasks wait, glide to the front, and pulse while executing. A spinning app-icon freezes exactly when the main thread is busy — visualizing "jank" — while live readouts track simulated frame rate, cumulative dropped frames, pool utilization and queue depth, following the same 16.67 ms frame-budget arithmetic that GCD dispatch queues, Android Executors and Kotlin coroutine dispatchers are built around.

⚙ Under the hood

Route simulated background tasks onto a mobile app's UI thread or a worker thread pool and watch frame drops, jank, and pool utilization respond in real time, following the same 16.67 ms frame-budget model that GCD, coroutines, and Android Executors are built to respect.

threadingconcurrencymobileschedulingperformanceframe-budget

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)