desmosinc / mathquill

Magic textboxes where you can type math as easily as writing!
mathquill.com
137 stars 42 forks source link

Remove renderLatexMathEfficiently #228

Closed jwmerrill closed 2 years ago

jwmerrill commented 2 years ago

Adds a new benchmark to measure performance of updating a decimal mathquill. To run the benchmark, do

make benchmark
open benchmark/update.html

This benchmark shows that renderLatexMathEfficiently is no longer a measurable win, and it has been a source of bugs recently.

For reference, renderLatexMathEfficiently landed in https://github.com/desmosinc/mathquill/pull/73

jwmerrill commented 2 years ago

Update: it turns out the original benchmark wasn't actually exercising renderLatexMathEfficiently because it doesn't run in case you call the public API .latex() method with a number rather than a string.

After updating the benchmark, I'm measuring renderLatexMathEfficiently at 12ms/100 updates and renderLatexMathFromScratch at 41ms/100 updates.