Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. WebWorker API > How Browsers Handle JavaScript

How Browsers Handle JavaScript

JavaScript runs in the same thread as the rest of the browser UI, and as the interpreter, it pulls event handlers off the event loop as they are queued for execution. This queue is shared with all event handlers to include those initiated by user interaction. In [Hack #65] we will compare the perceived performance of array manipulation both within the main thread and within a dedicated worker. If you haven’t witnessed the power of offsetting work to a worker, you will get a clear demonstration in the first hack.

JavaScript code bases continue to grow, and as more JavaScript runs, more applications block, waiting for the code to finish. Ultimately, we end up with unresponsive script prompts.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint