metarhia / metasync

Asynchronous Programming Library for JavaScript & Node.js
https://metarhia.com
MIT License
206 stars 35 forks source link

Optimize metasync.map() #225

Closed NazarPonochevnyi closed 7 years ago

NazarPonochevnyi commented 7 years ago

The creation of variables was postponed after checking for the availability of data.

DzyubSpirit commented 7 years ago

Do you think creating array with [] is faster than with new Array(0)?

NazarPonochevnyi commented 7 years ago

Thanks, changed.

DzyubSpirit commented 7 years ago

@NazarPonochevnyi, sorry that I mislead you: I'm thinking that both options have the same speed. And just asked if you know something that I don't know about that :)

NazarPonochevnyi commented 7 years ago

@DzyubSpirit, yes, I ran the tests for a while, and it turned out that both methods pass in the same time. So I reverted commit.

NazarPonochevnyi commented 7 years ago

Good)

tshemsedinov commented 7 years ago

Landed in df29b3f