Commit c441ba3a authored by Committed by Michael Aaron MurphyBrowse files
Reduce allocations and cloning (#271)
This is a pretty huge rework, replacing String with a custom SmallString based on a SmallVec of bytes. Replacing newlines with spaces is now done in-place, and most (for some value of "most") strings can now be stored on the stack. This should reduce allocator load, but it also improves cache locality. Whatever the real reason is, each of these changes provides a real, measurable speed boost, and they combine to give an improvement of something like 20-25%, meaning we're now 30-35% faster than Dash. This is a breaking change, replacing some uses of String with SmallString or &str in the public API, but I'm pretty sure no-one's hooking into our public API anyway so that should be OK.