-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
remove time + pessimistic_sleep #45
Conversation
I used it assuming it was doing something clever on the GPU, if that's not the case then there's less motivation for it. It does seem like there should be an easy way to do realtime animations in a way that's synchronized with the frame-rate, and having a |
I think, the most idiomatic code should look like this: while isopen(scene) # or whatever loop, event callback one wants to chose
scene[:value] = newvalue
...
# or recordframe! or actually just a yield() which should, but is not guaranteed, to yield to renderframe in the actual renderloop
renderframe(scene)
end |
I still need to try this out locally, but thanks for addressing this so quickly! I do feel that the burden of animations should be on either the user or some other package, since the decision of when to yield and render can vary based on the situation, so this makes sense to me! |
yeah it should be programmed to at least opt out in some way.. not sure if we could get the best of both otherwise |
Just confirmed that this branch brings down CPU load to about 1% or less in htop. Great work! |
I was thinking, I could check if time has any registered observers... But I'm not sure if I want this kind of special treatment and check every loop iteration ;) |
this will remove the time attribute from a scene, since this was always waking up the whole event loop.
Removing it decreased the time spent on the cpu from ~20% to ~0 cpu usage for idle time.
I'd say, people should just implement their own loop for doing animations relying on the time.
cc @jpsamaroo
@ssfrr, what do you think, you used
scene[:time]
so far.