6 ms·
Yeah I'm not very happy about needing to allocate an n sized array for sort operations, but it doesn't look like there is any way around it. To be clear, the s
by woodman 11y ago
Yeah I'm not very happy about needing to allocate an n sized array for sort operations, but it doesn't look like there is any way around it. To be clear, the struct is really just a opaque data type for what is essentially a dynamically defined struct of arrays. Most of the work has gone into compressing the array contents, as memory is the primary point of concern. I look forward to finishing it so that I can rewrite it a few more times :)
- CyberDildonics 11y agoYou can always sort portions of it and then merge those portions. In that case it might actually make sense to use packets on dense memory in a linked list. You could put the packet with the highest high value ahead of the other and merge middle out.
- woodman 11y agoYeah, I'd considered something like that to avoid large reallocs - I hadn't considered independent sort state for each chunk. That would allow for a single compile time constant sort index. Sounds like a good idea, thanks for that.
- CyberDildonics 11y agoNo problem, let me know how it turns out, it would be very satisfying to me if it ended up working well.