-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
iOS mobile windowing-related performance regression and log spam #16541
Comments
This is important to me, but I don't see an imminent easy fix at this stage. We'll do our best to backport anything that's done though. |
ok instrumentation reveals that we spent 15% in The reason for this is because we detect a new unseen monitor each frame and spawn it: bevy/crates/bevy_winit/src/system.rs Line 166 in 75c92fb
just to delete the old one from last frame: bevy/crates/bevy_winit/src/system.rs Line 202 in 75c92fb
which triggers exactly the logging line that we see spamming: I am not sure yet why this is. Its almost as if we can't seem to rely on the |
No, this is not the behavior that we see on desktop, and I don't have a way to test mobile. But this is a good call out, we should investigate on the winit side as the id for the monitor should be stable, it's possible this is a regression there. |
I also imagine that there's a lot of cost to the info! log while it's spamming. Not that this is a "good" solution but compiling out that log may at least help the perf if we want a stop gap solution. |
60% of this is the span of |
UiKit: impl PartialEq for MonitorHandle {
fn eq(&self, other: &Self) -> bool {
ptr::eq(self, other)
}
} AppKit: impl PartialEq for MonitorHandle {
fn eq(&self, other: &Self) -> bool {
unsafe {
ffi::CGDisplayCreateUUIDFromDisplayID(self.0)
== ffi::CGDisplayCreateUUIDFromDisplayID(other.0)
}
}
} |
@madsmtm would be great to have your opinion |
Indeed, that's wrong, Winit is comparing the pointer address of |
The monitor log spam actually makes the real issue visible: we're running Fixing it is a good thing, but we should look again at how we handle the winit loop |
Bevy version
3d72e08
[Optional] Relevant system information
What you did
Just running the
bevy_mobile_example.xcodeproj
What went wrong
Console spamming of:
Otherwise visually the example seems to run fine in the simulator.
here is the log of the same example on bevy 14.2: https://gist.github.com/extrawurst/7cbbb5b1918b5876a93705b92d65e196
here is the entire log of the above example in 3d72e08:
https://gist.github.com/extrawurst/b91117297242d412091862db171e29ab
If you compare this to the 14.2 behaviour there are a few things very different:
processing non
RedrawRequestedevent after the main event loop: AboutToWait
we now seem to get this second log every frame:Monitor removed 4v3088#13262859010052
I wonder if this is all intended? The repeating
Monotitor removed
at the very least looks very wrong.Additional Information
This additional activity seems to mirror also the huge additional CPU load:
Average CPU usage in the example goes up from ~90% to >200%. This is a regression in my books.
The text was updated successfully, but these errors were encountered: