4 ms·
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. M
by jcampbell1 13y ago
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.
- lhorie 13y agoIt'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.
- jcampbell1 13y agoNo 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.
- lhorie 13y agoYeah 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.