Enable Breeze to run in Web Worker thread
Probably difficult to do at this stage, but it would be interesting to find a way to have breezejs run in a web worker...although maybe there's not enough of a performance benefit.
Myself and my development team have a fully functional version of breeze along with modified versions of jquery.js and q.js running completely under a webworker. We added a new way to execute breeze queries. It's basically the same as before except the promise is the callback for the web worker, and the function returns the breeze entities which are then imported into the main thread's entity manager. The UI remains fully functional, and multiple threads can stack and execute in parallel.
We have it working for GET and POST requests, and the wrapper class also includes complete support for breeze queries that were already executed (in which case the entities are returned from the entity manager cache instead of a server call.)
There is no lag in calling the web workers - the performance is incredible. On this crappy old laptop with 2 cores and 4 virtual processors, I click next on a paged UI grid 91 times - which created 91 threads all running breeze and making calls to the database server. Every one of the threads completed in under 30 seconds and all pages loaded . Since our UI only wants the most recent requested page - 91 in this case - the other 90 pages of data were simply cached in the entity manager.
The combination of offloading the database calls and entity creation to another thread thereby freeing the UI thread, and the ability to load entities from cache are major transformations to our application.
We used to have a "loading service" that would dim the main thread while database operations were happening. There's no need for it anymore, as the UI is always available.
Things like clicking a column header to sort. Most of the time, you click once - let the grid reload - then click a second time and let it reload. Now, you can double click the sort column and only the last sort is presented to the user. The other one is cached. Now, sorts in both directions are cached and respond immediately with data.
Running our application on a mobile device saw the most speed improvements, especially android devices with multiple cores.
No need to wait. Go here:
That post actually had everything we needed to create this wrapper class and web worker combination. The results were phenomenal.