All checks were successful
/ Build-Stuff (push) Successful in 5s
Also introduces an optimziation that uses the stack, if the buffer size required, is lower than a pre-determined threshold |
||
---|---|---|
.gitea/workflows | ||
benchmarks | ||
src | ||
tests | ||
README.md | ||
meson.build |
iosifovitch
Iosifovitch is a blazingly faster implementation of the Levenshtein distance function metric.
This version is a complexity wise identical version to a version that has since been lost. It is not as fast as the original, since it currently overallocates memory, to serve as a buffer for storing results.
Plans for further development
- Make benchmarks.
- Introduce more tests.
- Tests with pre, post and infix strings shared between the strings
- Tests where the length of the strings are combinations of odd and even.
Reduce the size of the buffer. When this was done with the old version, performance was increased 100%.- Look into SIMD instructions
- Look into parallelism.
- Templating the code
SIMD
I have some ideas for how SIMD instructions might be possible to use to improve performance, but I doubt it will have much effect on small strings and it might even be detremental if the strings are too short.
The most straightforward approach would be to just do more than one calculation at a time, shifting the results down the SIMD registers.
Parallelism
It should be possible to do the calculations recursively, by splitting the longer string in the middle and then calculating the two parts sperately.
If that can be done, it should be easy to turn on the threads and make run this on all the cores.
Templating the code
There's nothing in the code that's specific to std::string
, and there's no
real reason for keeping it restricted to std::string
. Making this a template
should be trivial.