dbautistav / workers

Workers test-drive

Home Page:https://dbautistav.github.io/workers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Workers test-drive

This is just a demo comparing single vs multi thread (via workers) versions of the "same" page in terms of performance.

screenshot

You can play with it here: https://dbautistav.github.io/workers (assure you to check the disclaimer first).

Single thread version

This version loads a "large file" (~49.7 MB) (Ecobici users data at Mexico City for november 2015) from main thread and plots it. The red square is animated via JS while the numbered cube is CSS animated therefore the first one is affected when the file is loaded but the other one no.

Multi-thread version

Just like single thread version but the main thread "creates" a service worker for loading the data and also registers a web worker to enable caching and offline capabilities. Later the loaded data is transferred from worker to main thread and plotted. Since data load is done at service worker thread this does not affect JS animation (red square). Web worker effects are specially noted when refreshing the page or visiting the site without network connection after first full load (visible chart).

Disclaimer

WARNING: displaying the demo could hang your tab, browser or even your entire device (since the earlier is really heavy due to associated data: ~52 MB (~13 MB gzipped)). I recommend to save every work in progress at every single application which you were working on your device before checking the demo otherwise you may lose unsaved data. I also discourage use mobile data to access this demo and look for a Wi-Fi connection instead.

LICENSE

This demo is Free Software.

About

Workers test-drive

https://dbautistav.github.io/workers

License:GNU Lesser General Public License v3.0


Languages

Language:JavaScript 55.2%Language:CSS 24.9%Language:HTML 19.9%