uhho / density-clustering

Density Based Clustering in JavaScript
MIT License
214 stars 33 forks source link

Splice eating up the stack memory #8

Open YouriT opened 9 years ago

YouriT commented 9 years ago

Hi,

Thanks for your work! Just having an issue with your implementation because in my case I'm working with 21k+ elements in the table and therefore your PriorityQueue implementation (which uses splice) eats up all the available stack memory.

I don't think I'm doing something wrong, but tell me if so. However, a solution to this issue could be to use a setImmediate(...) function in NodeJS and a setTimeout(..., 0) in the browser. That would let the time to the garbage collector to do it's duty.

What do you think?

Cheers, and thanks for this great work!