Description
Describe the bug
- Load the OSD tab using virtual connection on a slowish computer (Chromebook)
Profiling shows about 1.7s of total time is spent handling the font download, about 0.9s of which is self time in toDataUrl
:
betaflight-configurator/src/js/tabs/osd.js
Line 3507 in 1809bb8
It looks like the code parses the font file characters and then calls pushChar
for all of them and that function ends by calling draw
for every character which force-renders them (and also caches them):
betaflight-configurator/src/js/tabs/osd.js
Line 133 in 1809bb8
I can't easily stub this out to try, but it seems to me that the artificial call to draw
from pushChar
is unnecessary and could be removed which would wait to render each character until it was needed (many of which won't be needed at all) and would still be cached.
To Reproduce
See above
Expected behavior
Faster, please :)
Configurator version
11.0.0 (1809bb8)
Flight controller configuration
Add any other context about the problem that you think might be relevant here
N/A