narui icon indicating copy to clipboard operation
narui copied to clipboard

Would be nice to have a with_capacity() constructor for Freelist

Open alexpyattaev opened this issue 1 year ago • 0 comments

Just benchmarked your freelist implementation, and it is remarkably fast. Sadly, it lacks a way to preallocate the memory which tanks performance early on. Could you please add the with_capacity constructor? It should be fairly trivial as far as I understand. You'd just need to change this line to Vec::with_capacity() and you basically get ready-made with_capacity constructor. https://github.com/apertus-open-source-cinema/narui/blob/2c758be6c6d6bcc70011ca62f30c9ae91fb06806/freelist/src/lib.rs#L42 Thanks!

alexpyattaev avatar Mar 26 '23 18:03 alexpyattaev