robotopia-x / robotopia

:robot: Introducing kids to coding with tiny virtual robots!
https://robotopia-x.github.io/
MIT License
511 stars 56 forks source link

Blockly editor is getting slow after a while #119

Closed paulsonnentag closed 7 years ago

paulsonnentag commented 7 years ago

The blockly component has a memory leak. Currently, every time the props change we create a new headless workspace from the xml and check if the code generated from it has changed. This is very inefficient. We should probably implement a real diffing algorithm but right now I'm going to just add a memoize key. So basically the solution @timgrossmann implemented a few months ago 😄

The solution is to call workspace.dispose() on the temporary "compare workspace". Even if it's not added to the dom. It won't get garbage collected otherwise.

- [ ] add memoize key - [ ] change key in level/editor