gbv / cocoda

A web-based tool for creating mappings between knowledge organization systems.
https://coli-conc.gbv.de/cocoda/
MIT License
39 stars 5 forks source link

Try to use Web Workers for certain tasks to improve performance #632

Open stefandesu opened 3 years ago

stefandesu commented 3 years ago

"Web Workers are a simple means for web content to run scripts in background threads." We could try to move certain tasks to a Web Worker in order to ease the JavaScript main thread and improve performance.

To start, we could perform loading concept data inside a Web Worker, for example.

Vite natively supports Web Workers, so implementation should be easy. However, I'm not sure if we can use dependencies inside of Web Workers, so this might make things more difficult.

stefandesu commented 3 years ago

Some more resources on Web Workers:

nichtich commented 3 years ago

To start, we could perform loading concept data inside a Web Worker, for example.

I think cost of loading is mainly network but Web Workers can only help to speed up computation.

stefandesu commented 3 years ago

I think cost of loading is mainly network but Web Workers can only help to speed up computation.

Yeah, that might be the case. As I'm currently finding out that Cocoda's slowness seems to come mainly from inefficient computed properties, this might not be necessary.

stefandesu commented 2 years ago

This might still be interesting to consider for certain cases, but it's not immediately relevant anymore, so I moved it to 2.0.0.