You
cannot generate 2000 updates a second if your computer cannot handle them.
Javascript runs a "main loop" that just executes "tasks". Tasks are chunks of synchronous code, and are not preemtible.
Let's say you have a "generator" task that generates 2_000 "update" tasks. The way this works is:
1. "generator" schedules 2_000 "update" tasks to run as soon as possible, and schedules another "generator" task for 1s from now.
2. The browser starts running "update" tasks one after the other as fast as it can.
3a. If the "update" tasks are all done 1s after the previous "generator" task, then the browser will run "generator" again.
3b. If they are not done, the browser will continue running "update" tasks and only invoke "generator" again _after_ it has finished with all the "update" tasks, be it 1 or 100 seconds after the previous "generator" task.