Re: Optimizing basic operations
- Posted by DerekParnell (admin) Aug 10, 2013
- 5155 views
DerekParnell said...
Yep, that's pretty much exactly what I suggested too. Only instead of a min-heap structure I just used a sorted sequence with a binary search for insertions - which would be much fast than a heap structure.
I stand corrected. Out of curiosity, I wrote a basic heap (priority queue) library and tested your idea with it and it was about three times faster than my first efforts. In fact, I can process a billion records in about 40 seconds.
If anyone is interested, I'll submit the library for public/peer review and thus possible inclusion into the standard library.