Commit Graph

7 Commits

Author SHA1 Message Date
Elf M. Sternberg a6d4fda582 Minor re-arrangement for compatibiility. 2022-11-13 12:40:39 -08:00
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
Elf M. Sternberg bf2b2715d4 Just pushing stuff around. Note: It was _dictd_ that has the nifty GZIP-with-indexes tryck. 2021-07-06 18:09:30 -07:00
Elf M. Sternberg 965df106d9 Separation of concerns. We now have a trait for identifying
a database type, and an implementation for mLocate.  That's a
start.
2021-07-06 18:03:30 -07:00
Elf M. Sternberg 3f7ae7bd8b Add a README and LICENSE file. 2021-06-24 11:59:47 -07:00
Elf M. Sternberg 76a905da4e Successfully read the mlocatedb header.
This commit shows how to read the mlocatedb header,
with a test to assert that the read is correct.
2021-06-23 19:00:56 -07:00