-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #36748 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information
Showing
1 changed file
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters