chikamichi / typometer

A silly micro-app to teach myself some FRP using Cycle.js — can you type that fast?
https://typometer.netlify.com/
MIT License
0 stars 0 forks source link

Improve re-rendering strategy #46

Open chikamichi opened 5 years ago

chikamichi commented 5 years ago

LiveText's view currently re-processes all characters on every keystroke. The virtual DOM makes it efficient painting-wise, but internally that's non sense as it has the potential to slow down the application when processing long texts.

Only actually edited characters should be re-processed upon keystroke.

TargetText#map is fine as it is, but another, utility function should be added to process only those characters that have changed since last processing.