
64 4. Getting Serious with JavaScript
e end result was pleasantly surprising. e manually packed version is tremendously
faster than relying on default cloning, taking an average of only 60 to 600 milliseconds
to complete. While it has to be manually maintained, this technique allows us to pack
all objects and their properties, including strings, into a single typed array for ecient
transfer.
4.3.4 Making Optimal Use of Multiple Cores
A common technique in multithreaded programming is to use as many threads as cores
available to achieve maximum parallelism. If we use too many threads, performance
will suer due to excessive context switch