Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDo not wait for rAF to be requested #114
Conversation
| @@ -113,8 +113,8 @@ impl Session { | |||
| let _ = self.sender.send(SessionMsg::SetSwapChain(swap_chain_id)); | |||
| } | |||
|
|
|||
| pub fn request_animation_frame(&mut self, dest: Sender<Frame>) { | |||
| let _ = self.sender.send(SessionMsg::RequestAnimationFrame(dest)); | |||
| pub fn start_render_loop(&mut self) { | |||
This comment has been minimized.
This comment has been minimized.
| return false; | ||
| } | ||
| }; | ||
| let _ = self.frame_sender.send(frame); |
This comment has been minimized.
This comment has been minimized.
jdm
Dec 19, 2019
Member
So if I understand correctly, this is the big difference here - immediately after finishing a frame we wait for the new frame, but instead of storing it in current_frame and then grabbing it next time script tells us that it's time to start a rAF, we send it to script immediately which then causes a rAF callback task to be queued.
This comment has been minimized.
This comment has been minimized.
Manishearth
Dec 19, 2019
Author
Member
Yes. Note that in the current implementation script always calls request_animation_frame immediately after render_animation_frame, so it seems like this should not cause any improvement, however it's possible that the extra IPC overhead plus the fact that the event loop is being pumped by the main thread which may decide to do something else are conspiring to cause problems.
|
This provides a slight improvement, might as well land it. r? @jdm |
|
@bors-servo r+ |
|
|
Do not wait for rAF to be requested This does not make the render loop _completely_ independent of script: it still waits for script to submit a frame. If we don't, frames will be dropped (and I'm not sure what strategy to use there). I'm going to test this soon and see if it actually improves our framerate. Servo side: servo/servo#25343 r? @jdm
|
|
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Do not wait for rAF to be requested in render loop Servo-side of servo/webxr#114 r? @jdm
Manishearth commentedDec 19, 2019
•
edited
This does not make the render loop completely independent of script: it still waits for script to submit a frame. If we don't, frames will be dropped (and I'm not sure what strategy to use there).
I'm going to test this soon and see if it actually improves our framerate.
Servo side: servo/servo#25343
r? @jdm