[sword-devel] Performance tip: Multi-threaded update of remote sources

Tobias Klein contact at tklein.info
Mon Jan 6 01:58:45 MST 2020


Hi,

Some time ago I found that the needed time for the update of remote 
sources can be dramatically reduced by using a multi-threaded approach.

Instead of calling installMgr->refreshRemoteSource(source) sequentially 
for all sources this can be done in one thread for each remote source.
Using this approach, the time for the remote source update is reduced 
from ~30 seconds to ~7 seconds, which is much nicer for the user, 
especially if it's done every time you open the "module install dialog".

You can find an example for this here, using C++11 threads: 
https://github.com/tobias-klein/node-sword-interface/blob/0.106.0/src/sword_facade.cpp#L163

Best regards,
Tobias




More information about the sword-devel mailing list