StringSimilarity.NET icon indicating copy to clipboard operation
StringSimilarity.NET copied to clipboard

Add benchmark project, some small optimizations

Open paulirwin opened this issue 1 year ago • 0 comments

This adds a BenchmarkDotNet project so that we can measure improvements (or regressions) with different changes.

This also does some improvements to reduce execution time and allocations on some benchmarks:

  • Cosine: 355 -> 331ns, allocations 896 -> 816B
  • Jaccard: 524 -> 502ns, allocations 1272 -> 1264B
  • QGram: 622 -> 503ns, allocations 1272 -> 1144B
  • SorensenDice allocations 1272 -> 1144B (note: slight perf regression 510 -> 557ns)

paulirwin avatar Jun 03 '24 00:06 paulirwin