-
Notifications
You must be signed in to change notification settings - Fork 35
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
Significant performance degradation on complex model #348
Comments
@fsudaman I'm interested to start using floorspace. At what number of zones/rooms/floors/whatever does this start to occur? Thank you! |
Hi @Mathadon, I work with @fsudaman The lag accumulates over time, but is not too bad up to 100 or so zones. However this was a 4 storey hospital, so it got complex pretty fast. A workaround that I found was saving and then deleting each floor as I went, to reduce the size and thus the lag. I then stitched the floors together using an online JSON editor. It got the job done, but it was pretty painful, and floorspace would be much better if the lag issue was resolved. |
Thanks for the feedback @Mkellyeng, NREL doesn't have any active development activities for FloorspaceJS (we will look at fixing bugs in the OpenStudio FloorspaceJS translator). However, @bgschiller and others at Devetry are very capable of fixing bugs/performance issues in FloorspaceJS. You might reach out to them if you are interested in discussing ways to work on your concerns. |
@Mkellyeng @fsudaman: As @macumber mentioned, there's not a lot of active development on the project (NREL hired us at Devetry to get it to the current state, but there's no current contract). That said, I have some thoughts on how to clear up some of the lag. I've been noodling on it since this issue was raised and I think there are two main sources:
Some things to consider: we would need to convert back to a list upon "export", as that's the format expected by OpenStudio downstream. Luckily, we have tests to prevent us messing this up 😁 . Also, it's likely we would need to begin including an explicit "order" property, since objects are not ordered and we're currently relying on the list to maintain the proper order of our stories. If someone wanted to tackle this, the best place to start would be in the
To tackle this, you'd want to visit timetravel.init(store); Happy to review and provide feedback if you get a chance to work on this! |
Thanks @macumber and @bgschiller for the details provided here as well as offering the support. I will discuss this with the team and assess if we can take this on. In parallel, I will drop you an email as well to explore the alternate option. |
I have noticed that adding a new 'Space' to the model linked by @fsudaman is very time consuming. After adding additional console logging it was discovered that the dropDaylightingControls method in mutations.js is taking over 7 seconds to run.
dispatching action: models/destroyAllComponents The bulk of the time is consumed by the following operation: Would it be possible to modify the code by adding an additional 'if' check? This reduces the execution time of dropDaylightingControls to a fraction of a second in our scenario:
I am not sure of the impact this would have on floorspace? Speeding up this method is not a complete fix, as the operation of adding a Space still takes an additional few seconds. Some of the suggested items were investigated to see if they had performance improvements. We (@fsudaman, @Mkellyeng and myself) did not find that these changes improved performance:
Some screenshots: |
@aaroncoderepo Thanks for your exploration of the causes of the slowness! It will be no problem to add that if-statement. I'm surprised that the undo/redo stack doesn't seem have an affect on the speed, but 🤷♂️. |
Thanks for reviewing my code, how would you like to proceed @bgschiller ? I can create a branch, and pull request for this change - but I don't seem to have permissions (403 error) to push a new branch to this repository. |
@aaroncoderepo you should be able to open a pull request from your fork. If that doesn't work, just point me to where your repo lives. |
Unfortunately we found that the performance savings we noticed (with the above change) when debugging locally did not translate when deployed. The seven second delay does not appear in our hosted environment (I can only speculate as to why this is the case). |
Still to do: profile and understand the biggest contributors to slowdown |
Some details to add to this that I've noticed over time
The libraryObjectWithId function is a possible culprit (helpers.js). It seems to take an ID and tries to figure out what it belongs to by looking everywhere in the file for it, but the way it searches seems pretty inefficient. It looks like it gets called frequently |
Looking at the performance chart in chrome, the browser spends an awful lot of time running through The other thing that jumps out to me is that dimensions are frequently set one by one, e.g. floorspace.js/src/components/Grid/methods.js Line 1338 in fe341ea
@Mkellyeng Do you have an example with some images to do testing with? |
I put together a PR with some of the changes - #392 The changes are a little rough around the edges. |
@benfen do the performance updates in #392 address speed of non-drawing tasks as referenced in openstudiocoalition/OpenStudioApplication#118 ? |
In the webapp, those actions are all quite quick. However, they were fast before any of these performance changes were done, so it was likely fixed by another change. |
I took a second look at it and I'm seeing some of those same issues; I'll look into speeding them up |
Awesome! |
FloorSpace's performance and responsiveness degrades significantly as models get more complex, to the point where it can be quite arduous to work with or almost unusable.
The attached model allow you to reproduce the issue where an average of 1-2 second delay is observed on every mouse click, which makes it frustrating to do anything other than minor adjustments.
Performance Degredation.zip
The text was updated successfully, but these errors were encountered: