Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your jsperf test is not measuring the same thing as the other frameworks.

You need to insert m.redraw() in the loop to make the comparison apples-to-apples. My test shows it is as 3x faster, not 100x which is completely implausible.



It's not my test, but m.endComputation() - which is in the loop - does call m.redraw() internally.

With that being said, if there's something there that is wrong that I'm not seeing, I'd be happy to hear it, as I am skeptical about the number as well.


No it doesn't. It calls redraw(), not m.redraw().

redraw() is debounced. m.redraw() is not. The test doesn't redraw every loop, it redraws every 16ms.

You need to call m.redraw() in the loop to get an apples to apple comparison.

Edit: Also your post redraw hook looks really buggy. It can run before the redraw actually happens.


Yeah sorry, you're right. Just as I went out for lunch, it occurred to me that I was looking at a bleeding edge version (which has a refactor of this code) and not the version being used in the test.

I had a feeling there was something fishy about the number but I couldn't quite put my finger on it. Thanks! :)

PS: and thanks for catching that post redraw hook issue; I'll add a fix for it.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: