Comments (2)
There is a memory leak! I can't seem to recreate the slowness issue to confirm that my solution does anything to helpπ but the memory issue does exist.
The problem is that in many visualizations the value of nextIndex
continues to grow infinitely. It's more problematic on algorithms than data structures, because with DS each operation adds a small constant amount to nextIndex
but with algorithms it adds a larger amount proportional to the input size.
And the issue obviously isn't just the integer nextIndex
, but what it represents which is the label # of the next animated object. At any time there is an array of animated objects being stored in this.animationManager.animatedObjects.nodes
, and as nextIndex
grows so does the array. This leads to potentially hundreds of empty indices in the array each time the algorithm is run, which grows to thousands over time.
One solution that's already (sort of) being used in some visualizations is a "reset index", that allows for some constant objects to avoid be reinstantiated and resets nextIndex
each time the algorithm is re-run.
Here's an example of that idea being implemented in Quicksort
Is there any particular vis where you noticed performance issues? We could test this fix there first
from visualization-tool.
I noticed it on algorithms like you said. On LSD Radix Sort, it happened during Dr. HB's lecture. I think she had the page up for a while off-screen, then when she pulled it up to demonstrate something, it was extremely slow. But what's curious is I don't know if repeatedly running the algorithm is the only cause - it seems like it just happens if you leave the page open for a while in the background? I'll try and see if I can replicate it by doing that.
from visualization-tool.
Related Issues (20)
- Footer alignment issues
- Custom graph builder
- QP HashMap doesn't show resize case for maximum probes
- Better transitions on LSD Radix Sort
- Selection Sort default to Maximum
- Random input pseudocode overlap HOT 1
- Input fields for pattern matching are too short
- More Random Inputs for Pattern Matching
- Rabin-Karp clarity
- Reset & Random buttons should cancel animation HOT 1
- [Feature] Survey banner
- Improve Step Back/Step Forward
- Error messages and shake animation during skip back
- HashMap (Probing): Cannot modify initial capacity
- Fix Dijkstra's animation imparity
- Fix gray "wall" over screen when scrolling horizontally on smaller screen
- Linear Probing HashMap should stop probing after seeing size non-removed entries
- HashMaps should resize to 2*capacity+1 instead of 2
- HashMaps should resize to 2*capacity+1 instead of 2*capacity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visualization-tool.