-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile legacy implementations for a fair and realistic benchmark comparison. Remove obsolete benchmarks. ref #20
- Loading branch information
Showing
10 changed files
with
841 additions
and
1,107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
benchmarks/ | ||
legacy/ | ||
dist/ | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,5 +106,5 @@ dist | |
# TypeDoc | ||
docs | ||
|
||
# Benchmark | ||
benchmarks | ||
# Compiled legacy artifacts | ||
legacy |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {describe, bench} from 'vitest'; | ||
|
||
// It's important to use the distributed versions for a realistic comparison | ||
import {toMonzoLegacy, primeLimitLegacy} from '../../legacy/legacy'; | ||
import {toMonzo, primeLimit} from '../../dist'; | ||
|
||
function randInt() { | ||
return Math.ceil(Math.random() * 1000000000); | ||
} | ||
|
||
describe('Number to prime exponent vector conversion', () => { | ||
bench('Old implementation', () => { | ||
try { | ||
toMonzoLegacy(randInt()); | ||
} catch {} | ||
}); | ||
|
||
bench('Using probes without division', () => { | ||
try { | ||
toMonzo(randInt()); | ||
} catch {} | ||
}); | ||
}); | ||
|
||
describe('Prime limit calculator', () => { | ||
bench('Old implementation', () => { | ||
primeLimitLegacy(randInt()); | ||
}); | ||
|
||
bench('New implementation', () => { | ||
primeLimit(randInt()); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.