rjs-team / rjs

Native Javascript environment using Rust and Mozilla's SpiderMonkey JS engine.
9 stars 3 forks source link

Figure out why communication between JS and the Window are so slow #6

Closed ErichDonGubler closed 6 years ago

ricochet1k commented 6 years ago

Specifically, JS can call ping on window, which prints ping, and then prints a pong from the window thread. It looks like 10 or so pings are sent in a row, at 0.5 second intervals, before all the pongs are received all at once. Nothing is waking up the thread?

ricochet1k commented 6 years ago

If the glwindow.swap_buffers() call is commented out, pings are answered almost instantly, as expected. I suspect that a swap_buffers with vsync on may wait too long and cause the Interval to request a run immediately, which may starve the other recv_msgs stream.

ricochet1k commented 6 years ago

Fixed in 60c6dc9844c1ccf94de7c538ba274d816c7df837