-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Investigate: Tyrian apps seem CPU intensive #254
Comments
We speculate that this is due to the hot render loop. |
I've spent some time butchering the runtime and trying out different things. My own linux machine seems to show even higher CPU load than I recall the original reporter talking about. Some findings:
So fundamentally, the CPU load seems to be coming from Surely this can't be the case?! How does Elm cope? Well on my machine... Elm has almost the same problem. Maybe slightly better, depending on the type of app your running, but not much. Certainly when I'm interacting with an app there is no real difference Still, is there anything we can do? Well, we render on frame tick if there has been a model change. We do that because if you're doing heavy updates you don't want to be re-rendering for nothing, but it adds constant load. If you render only on The only other thing I can think of is to do a hybrid. In this model you render on requestAnimationFrame, as long as you saw a message in the last, say, ~2 seconds. So if your app is idle, the rendering will go idle, but while stuff is happening (whether triggered by the user or anything else) the rendering continues. |
That is what my PR #255 attempted to do. I got side-tracked but I intend to take a second look and fix it :) |
No worries @armanbilge. I've been refactoring / toying with the runtime on and off over the last couple of days, a) because it feels like the only bit of the code base I'm slightly uncomfortable with - I'd like to fix that, and b) because I'd like to see if an improvement is possible before I cut another release. I am looking at it, but if you feel like you really want to jump back on it, do let me know. Your time is always appreciated. Equally I'm sure you're doing a bazillion other things, so don't worry over it either. 😄 |
Remove ModelHolder A model update triggers redraw Remove unused argument Call redraw on a rendering class Record last triggered time Minor refactoring Anemic Renderer Revert "Anemic Renderer" This reverts commit f297cb7. Imperative version, but it kinda works. Tidying up comments Use the model Ref to use all updates Replaced imperative impl with CE
Remove ModelHolder A model update triggers redraw Remove unused argument Call redraw on a rendering class Record last triggered time Minor refactoring Anemic Renderer Revert "Anemic Renderer" This reverts commit f297cb7. Imperative version, but it kinda works. Tidying up comments Use the model Ref to use all updates Replaced imperative impl with CE
If you run the standard g8 template, and then check the task manager in Chrome, you can see the Tyrian is using a surprising amount of CPU even when idling.
If may by an unavoidable overhead of the architecture, but maybe we just introduced a regression somewhere. Worth looking into.
The text was updated successfully, but these errors were encountered: