Speed up text slide processing
Issue
Loading text slides is slow. (It really should be instant)
Details
We render using a web-engine, any calls to the web-engine that require a return value is slow. When we process a text service item, each stanza must be checked if it actually all fits on the slide. This requires a call and reply from the web-engine which takes time. In addition, one service item is processed separately for the same theme about 3 times when sent to live. (I think it's once for each preview and the display) Turns out process_items
is called once for each stanza; There are some parallel code opportunities here.
Improvement ideas
- Calculate text width, line height,... in python/qt, avoiding calls to the web-engine. (This would be difficult and likely not perfect, web browsers have strange rendering)
- Attempt to parallelize processing code so we can continue processing without waiting for the web-engine. (This would speed up processing of text that does not require any splitting significantly)
Cache result so that we do not run the same code 3 times in a row (This should be easy and will significantly help speed up loading songs into live (probably half the loading time))
Notes
I noticed this when I was running some tests for #300. When calling the webengine for every line, it's very, very, slow!
Edited by Daniel Martin