-
Notifications
You must be signed in to change notification settings - Fork 21
Add Array.fill to array append benchmarks #39
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
base: main
Are you sure you want to change the base?
Conversation
|
||
bench('fixed size fill(a,b,c)', total, () => { | ||
const array = new Array(total) | ||
for (let i = 0; i < total; i++) array.fill(i, i, i+1) |
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.
Why do we expect this bench to be different from the first one?
for (let i = 0; i < total; i++) array[i] = i | ||
}) | ||
|
||
bench('fixedArray[i] = i DESC', total, () => { |
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.
Same question. Is it expected to be slow than ASC?
}) | ||
|
||
bench('Array.fill', total, () => { | ||
const array = Array.from(total).fill('test') |
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.
This concat two operations. I don't think we should include it
Co-authored-by: Rafael Gonzaga <[email protected]>
Co-authored-by: Rafael Gonzaga <[email protected]>
Co-authored-by: Rafael Gonzaga <[email protected]>
Co-authored-by: Rafael Gonzaga <[email protected]>
No description provided.