NREL / floorspace.js

Other
66 stars 35 forks source link

Performance test #314

Open macumber opened 6 years ago

macumber commented 6 years ago

Draw a medium complex floorplan, duplicate on N stories, ensure that performance does not degrade

bgschiller commented 6 years ago

Performance does degrade, but it sounds like we're going to leave this with just the test for the moment.

For the future, it's my suspicion that some of this slowdown is caused by the way we're storing the story and geometry models. Each is a list of objects with keys. When we want to update any model, we pass along the storyid, which does a `.find(stories, { id: storyId })`, to find the correct one. That incurs an O(n) lookup several times for any update. I think it would be better to store this as an object keyed by id instead.