Skip to content

Use CMOV instruction to speed up min()#51

Merged
lithammer merged 1 commit intomasterfrom
cmov
Apr 28, 2023
Merged

Use CMOV instruction to speed up min()#51
lithammer merged 1 commit intomasterfrom
cmov

Conversation

@lithammer
Copy link
Owner

This increases performance of min() by 1-18% depending on scenario.

                              │   old.txt    │               new.txt               │
                              │    sec/op    │   sec/op     vs base                │
LevenshteinDistance-8            61.08n ± 0%   56.71n ± 0%   -7.15% (p=0.000 n=10)
LevenshteinDistanceBigLate-8    11.239µ ± 0%   9.230µ ± 0%  -17.88% (p=0.000 n=10)
LevenshteinDistanceBigEarly-8    9.424µ ± 0%   9.295µ ± 0%   -1.37% (p=0.000 n=10)
geomean                          1.863µ        1.694µ        -9.06%

Fixes #50

This increases performance of `min()` by 1-18% depending on scenario.

```
                              │   old.txt    │               new.txt               │
                              │    sec/op    │   sec/op     vs base                │
LevenshteinDistance-8            61.08n ± 0%   56.71n ± 0%   -7.15% (p=0.000 n=10)
LevenshteinDistanceBigLate-8    11.239µ ± 0%   9.230µ ± 0%  -17.88% (p=0.000 n=10)
LevenshteinDistanceBigEarly-8    9.424µ ± 0%   9.295µ ± 0%   -1.37% (p=0.000 n=10)
geomean                          1.863µ        1.694µ        -9.06%
```

Fixes #50
@lithammer lithammer merged commit a6d3776 into master Apr 28, 2023
@lithammer lithammer deleted the cmov branch April 28, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use of CMOV instruction in Levenshtein's minimum function

1 participant