-
Notifications
You must be signed in to change notification settings - Fork 149
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
Excessive develop memory consumption comparing to 0.4.0 #81
Comments
develop
memory consumption comparing to 0.4.0
@ryantrinkle could we have your comment on this one? |
I just started with reflex and ghcjs and was also quite buffled by it's high amount of memory consumption, compared to the purescript version I already have. I am glad to know that this used to be better and that it is not an inherent problem with ghcjs. |
@qrilka I'll definitely take a look at this. Thanks for supplying the code to repro it! It can be a bit tough to keep an eye on this sort of thing, but I'm hoping we can get a CI-based system set up soon, including your code as a test case. |
That's great @ryantrinkle |
Well, I think what we really need is some way to know when and where performance regressions are occurring. It might be a bit of a challenge, but if you can think of some ways to work towards narrowing down which commit might have caused this increased memory usage, that would be very helpful. |
Also perhaps an automated way of measuring memory consumption. Firing up Chrome developer tools manually takes time and effort. |
I also just ported an app to 0.5 and have also had a massive performance (both speed and memory) problems with creating tables. |
@george-steel Sorry to hear you've run into issues, although it's useful to have another point of comparison. Sorting out this issue is a top priority for me and my team. |
@ryantrinkle Here are some details of how I encountered the bug: I am displaying a table (about a dozen rows and 2 dozen columns) that has cells that get highlighted in different ways in response to user input. Using My app is now working, and hopefully this gives you some more info on the bug. |
@qrilka, @george-steel: We've put in place some changes that bring down the memory consumption - not quite to reflex-dom-0.3 levels, but much less than previously. Work will continue. |
That is awesome! I just noticed that my current reflex version takes far longer to build up the UI than my PureScript version, (instant versus, ok this loaded, now that, wait, ok now it is complete). I don't really know what's taking so long, but any performance improvements are good I guess :-) Compare: https://dev.gonimo.com (PureScript) The difference is big on mobile, on desktop not so much. |
@eskimor Thanks for that comparison. It's certainly helpful. I suspect that the majority of the difference you are noticing is simply the time it takes to download the Javascript. This would also explain the bigger difference on mobile. I would suggest compressing your JS with |
gzip -9 is used and also closure compiler. I wrote "build up the UI" on purpose, because I meant the time it takes to fully build up the UI and load data from server (Websocket) when everything is cached. Also the compressed JS with closure is only about two times as big as the PS version. |
I still haven't found a way to automate measurements (couldn't spend noticeable time on it :( ) so I've rerun "manual" tests and the results look quite good. At least overhead of 0.5 version seem to scale almost linearly with number of data object used.
@ryantrinkle feel free to close the ticket but probably it would be good to have another one about |
correction: memory consumption of 0.5 seems to grow almost proportional to the one of 0.4 |
@qrilka Oh! I should have mentioned that I automated the testing. See prof-huge-table-with, which you can invoke with a reflex-platform git hash to get a profile with it. |
I just updated reflex-platform again, starting times improved noticeable on my mobile! Still not great but a few seconds faster! :-) |
@qrilka I think this is sorted out now. Of course, there will be more improvements in the future, and it's now possible to compile to native ARM, but this specific issue is fixed. Thanks for reporting! |
Maybe it mostly comes from
reflex-dom
but I'm not quite sure how to trace it down properly.Here is a PR porting minimalistic example to 0.5.0 - qrilka/reflex-huge-table#1
I was using mostly Chrome task manager to check RAM consumption and running
make open
and then clicking "go" button showed the following result:in
master
version (usingreflex-0.4.0
) initially page consumed around 28M and after button click consumed RAM jumped to 60M then after some time it decreased to 43M and was almost stable showing numbers from 43M to 44Min
reflex-0.5.0
branch initially page was about 37M. After button click it jumped to 181M and didn't stop there and kept increasing up to 227M. Then probably some GC happened and memory shrunk to 152M. After that it wasn't quite stable and was showing numbers from that 152M up to 180MAlso I have used Chrome developer tools and took heap snapshots on initial page state and after table rendering.
Probably the way I build table in that example is not quite optimal (any advice on better way to do it?) but the main point is different run-time characteristics of the same code built with the same GHCJS running in the same Chrome but using different
reflex
andreflex-dom
versions.Please let me know how could I help debugging this issue further.
The text was updated successfully, but these errors were encountered: