os: performance improvement in vector allocation
We were using the result vector with an object which is not a primitive data type, and going with the constructor allocation pattern it creates a size of that vector and also initializes the spaces with the data type as well which is in our case is `Local<Value>`. It leads to waste of some CPU cycles and instead we just wanted to have some reserved space in our vector. We can use `reserve` method on vector to reserve some space for the vector but doesn't initialize the value since we are anyways doing it in the following loop. PR-URL: https://github.com/nodejs/node/pull/36748 Reviewed-By:Robert Nagy <ronagy@icloud.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
parent
341bbd38
Please register or sign in to comment