Skip to content

Conversation

@matiasinsaurralde
Copy link
Contributor

@matiasinsaurralde matiasinsaurralde commented Nov 5, 2023

Changes in this PR

  • Optimizes the mash similarity function: removed sort.Search usage, merged the early exit conditions and rewrote the sketch traversing logic.
  • Adds simple mash.Distance benchmark.

Why are you making these changes?

  • General optimization:
% benchcmp old.txt new.txt 
benchmark           old ns/op     new ns/op     delta
BenchmarkMash-8     118           9.71          -91.75%
BenchmarkMash-8     113           9.72          -91.43%
BenchmarkMash-8     113           9.71          -91.43%

benchmark           old allocs     new allocs     delta
BenchmarkMash-8     0              0              +0.00%
BenchmarkMash-8     0              0              +0.00%
BenchmarkMash-8     0              0              +0.00%

benchmark           old bytes     new bytes     delta
BenchmarkMash-8     0             0             +0.00%
BenchmarkMash-8     0             0             +0.00%
BenchmarkMash-8     0             0             +0.00%

Are any changes breaking? (IMPORTANT)

No - tests look fine

Pre-merge checklist

All of these must be satisfied before this PR is considered
ready for merging. Mergeable PRs will be prioritized for review.

  • New packages/exported functions have docstrings.
  • New/changed functionality is thoroughly tested.
  • New/changed functionality has a function giving an example of its usage in the associated test file. See primers/primers_test.go for what this might look like.
  • Changes are documented in CHANGELOG.md in the [Unreleased] section.
  • All code is properly formatted and linted.
  • The PR template is filled out.
@TimothyStiles TimothyStiles merged commit 58f8699 into bebop:main Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants