-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not using requestAnimationFrame? #100
Comments
Blah, I always keep forgetting to set that! I wish the BS build system had injection variables like Dune does then I wouldn't forget things like that... ^.^; Fixed in 64e977f, thanks much!! ^.^; But yep, that is what it does, false means it re-renders on every change (which won't affect most things speed, but if there are a lot of updates between frames then it sure would), and true means it doesn't call view at all except once per frame update cycle (or not at all if no changes were done). ^.^ |
BS-tea was using real-time rendering, rendering every event, instead of only rendering once every animation frame. OvermindDL1/bucklescript-tea#100
@OvermindDL1 yes it does ! https://bucklescript.github.io/docs/en/conditional-compilation#docsNav |
Ooo, the custom variables didn't used to exist... I'm going to open and leave this open to remind me the next time I mess around with that code, it will be great for synchronous testing and benchmarking the loop itself. :-) |
I'm debugging some performance issues in our app. While looking through the code I saw that bs-tea doesn't use requestAnimationFrame, seemingly by accident.
In scheduleRender, there's a comment:
Except it's false.
My reading is that the comment is correct, and that as currently set in the code, bs-tea does not use requestAnimationFrame. It seems like it should.
I tried setting it to true locally and got a very different profile for my app - I was observing a rerender on every keypress earlier with the real-time version, and now I see "Animation frame fired" in the chrome debugger, alongside a much better framerate and a profile behaving as you'd expect for requestAnimationFrame.
So I'm thinking you want to set the if statement to true?
The text was updated successfully, but these errors were encountered: