-
Notifications
You must be signed in to change notification settings - Fork 45
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
This tests are not valid. #15
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are not taking in consideration time needed to work with memory, but you have to in such tests, where main work depends exactly on construction of big arrays and freeing them before next test.
Simple example.
In mapPerformance(posts) execution time of "forEach" depends on running order,
just move "forEach" block before "for loop", and you will see it starts to run "faster" than "for loop".
I have changed order and added 2 copies of tests, several runs:
posts.length: 100000
What we see? What conclusion?
What can we say with confidence?
Just that forEach and for loop have no difference and you can choose what you want.
PS:
node v10.16.1
The text was updated successfully, but these errors were encountered: