MidCamp / live-captioning

Live caption with speech-to-text using the Chrome browser and your computer's microphone.
https://lc.midcamp.org/
GNU General Public License v3.0
159 stars 29 forks source link

Reduce memory pressure by avoiding innerHTML #3

Closed lotyrin closed 5 years ago

lotyrin commented 5 years ago

AFAIK, innerHTML causes copies / creation of transient DocumentFragments and shouldn't be used in loops / event callbacks for long-lived process and/or frequently changed UI elements. This instead reuses existing child and updates it in-place.

In any case it should be at least be an improvement to perf.

cc @cosmicdreams (who had mentioned some issues with the application crashing: this might be a cause?)