MarionetteLabs/marionette.inspector — pull request #89 by jasonLaster (2014-11-26 21:34:43+00:00)
Title: Add Lazy Worker

#### Overview:
One of the problems we've seen while auditing the inspector's perf, is that the injected script (agent) is a CPU hog during app start and app navigation. The reason for this, we believe, is that serializing hundreds of views and models can take about as much time as it takes to create and show the page layout.

Our solution for this is to defer the work of serializing the views and models until after the layout has been created and shown. Enters the LazyWorker. The LazyWorker is responsible for queueing up work that it will do when things settle down. Another feature of the LazyWorker is that it will not work for more than it's alotted time. That means that the LazyWorker should not use up valuable cpu cycles when we're showing a layout nor should it create significant jank because it does not run for too long either.

#### Tasks:
+ built lazyWorker
+ add lazyWorker to view serialization
+ add lazyWorker to model serialization
+ add lazyWorker to trigger calls