levenshtein-automata icon indicating copy to clipboard operation
levenshtein-automata copied to clipboard

update edition, switch to fx hashmap

Open PSeitz opened this issue 2 years ago • 3 comments

  • fix clippy
  • use fx hashmap
HashMap
test bench::bench_build_parametricdfa_damerau_perf_1         ... bench:       4,434 ns/iter (+/- 59)
test bench::bench_build_parametricdfa_damerau_perf_2_profile ... bench:      24,584 ns/iter (+/- 431)
test bench::bench_build_parametricdfa_damerau_perf_3_profile ... bench:     103,651 ns/iter (+/- 1,529)
test bench::bench_build_parametricdfa_perf_1                 ... bench:       2,661 ns/iter (+/- 39)
test bench::bench_build_parametricdfa_perf_2                 ... bench:      79,471 ns/iter (+/- 1,312)
test bench::bench_build_parametricdfa_perf_3                 ... bench:   2,848,942 ns/iter (+/- 19,061)


FxHashMap
test bench::bench_build_parametricdfa_damerau_perf_1         ... bench:       3,034 ns/iter (+/- 108)
test bench::bench_build_parametricdfa_damerau_perf_2_profile ... bench:      29,903 ns/iter (+/- 1,513)
test bench::bench_build_parametricdfa_perf_1                 ... bench:       1,939 ns/iter (+/- 21)
test bench::bench_build_parametricdfa_perf_2                 ... bench:      51,259 ns/iter (+/- 705)
test bench::bench_build_parametricdfa_perf_3                 ... bench:   1,894,284 ns/iter (+/- 25,625)

PSeitz avatar Jan 28 '23 08:01 PSeitz

What about aHash? I never tried it, but it can probably be interesting to see the performances diffs.

Kerollmops avatar Jan 28 '23 15:01 Kerollmops

Seems to be slightly slower than fx hash

test bench::bench_build_parametricdfa_damerau_perf_1         ... bench:       3,149 ns/iter (+/- 58)
test bench::bench_build_parametricdfa_damerau_perf_2_profile ... bench:      29,821 ns/iter (+/- 7,170)
test bench::bench_build_parametricdfa_perf_1                 ... bench:       2,020 ns/iter (+/- 60)
test bench::bench_build_parametricdfa_perf_2                 ... bench:      54,819 ns/iter (+/- 2,143)
test bench::bench_build_parametricdfa_perf_3                 ... bench:   1,924,384 ns/iter (+/- 45,537)

PSeitz avatar Jan 28 '23 16:01 PSeitz

@PSeitz I don't think adding this dependency is a good idea. Building the parametric DFA is a one-time thing.

Lucene just ships it in a serialized manner. Even the original paper just describes it without explaining the algorithm to build it.

fulmicoton avatar Feb 28 '23 02:02 fulmicoton