I put your code in a function and i get a perfomance hit in first call and after that its faster First call in node 11.14.0: loop: 270.822ms map: 1293.307ms Next calls in node 11.14.0: loop: 366.816ms map: 259.317ms undefined
test() loop: 304.949ms map: 76.464ms undefined test() loop: 290.823ms map: 76.344ms undefined test() loop: 293.326ms map: 73.094ms undefined test() loop: 288.508ms map: 77.012ms
In chrome i dont get any notable performance hit by using map instead of loop with these code.
That's interesting. I going to try that.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I put your code in a function and i get a perfomance hit in first call and after that its faster
First call in node 11.14.0:
loop: 270.822ms
map: 1293.307ms
Next calls in node 11.14.0:
loop: 366.816ms
map: 259.317ms
undefined
In chrome i dont get any notable performance hit by using map instead of loop with these code.
That's interesting. I going to try that.