-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance the benchmark #209
Conversation
Codecov Report
@@ Coverage Diff @@
## master #209 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 93 93
Lines 267 267
=====================================
Hits 267 267 Continue to review full report at Codecov.
|
0d928f6
to
455857a
Compare
455857a
to
58f3fe5
Compare
f592cd7
to
5ba342f
Compare
export function createBenchmark(title, testResult, pMaxTime = 30, pMaxOperations = 1000) { | ||
|
||
const fast = Boolean(process.env.FAST) | ||
const maxTime = fast ? pMaxTime / 3 : pMaxTime, maxOperations = fast ? Math.round(pMaxOperations / 3) : pMaxOperations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe on two lines so it would be clearer with the ternary operator ?
|
||
it('ES2015', () => { | ||
benchmark('es2015', 'ES2015 destructuring', () => { | ||
const start = randomStart(), end = start + modifySize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more readable than the previous one with ternary operators but i found it hard to view each variables at one glance.
|
||
it('ES2015', () => { | ||
benchmark('es2015', 'ES2015 destructuring', () => { | ||
const start = randomStart(), end = start + modifySize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could create a function getTestBounds which return an array with start and end value ?
|
||
const runs = [] | ||
|
||
function run(key, opTitle, operation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could add more comments to explain more your approach ? Or a pointer on the method you followed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll document in a later PR, created an issue #223
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍
}) | ||
} | ||
|
||
// Prepare immutalbe state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "immutable"
No description provided.