UI Deploy

Curated, Short, Web UI Dev we Love.

Non-blocking Asynchronous JSON.parse Using The Fetch API

The problem

I am working on Swagger Editor performance. One of the solutions to speed things up was moving process-intensive task to Web Workers. Web Workers do a great job of moving process-heavy tasks out of the main thread but the way we can communicate with them is very slow. For each message to be sent to or received from a worker we need to convert it to a string. This means for transferring objects between the main thread and worker threads we need to JSON.parse and JSON.stringify our objects back and forth.

view source

Advertisement