Commit Graph

2 Commits

Author SHA1 Message Date
Elf M. Sternberg 40811151ab The C and Rust versions are now comparable.
The C and Rust versions are now comparable, with a memory-reuse and
a memory-safe version for Rust.  The memory-safe version is five times
faster than the C version; the memory-reuse version (technically safe,
but can panic under some very rare circumstances) is ten times faster.

I suspect the reasons for he speedup are strictly in the `for()` loop
in the C version for copying the string, where the Rust version probably
uses memcpy() under the covers to transfer the short string into the
destination.
2022-11-13 12:33:34 -08:00
Elf M. Sternberg 2eab17934c Moved everything around so it's more project-y
Added the squozen patprep function, added unit tests to the
patprep `c` code, and ensured that the rust version works the
same way.  The only remaining code slowdown is that re-allocating
the Vec 50 million times turns out to be slower than re-using the
same slice of RAM over and over and over.
2022-11-11 08:31:22 -08:00