-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
os: performance improvement in vector allocation #36748
Closed
Closed
Conversation
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
nodejs-github-bot
added
c++
Issues and PRs that require attention from people who are familiar with C++.
os
Issues and PRs related to the os subsystem.
labels
Jan 3, 2021
yashLadha
force-pushed
the
improve_vector_allocation
branch
from
January 3, 2021 07:18
d3d391f
to
6dc0a6e
Compare
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.
yashLadha
force-pushed
the
improve_vector_allocation
branch
from
January 3, 2021 07:23
6dc0a6e
to
aa24929
Compare
No performance regression as such https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/866/console |
ronag
approved these changes
Jan 3, 2021
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Jan 5, 2021
aduh95
added
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
Jan 18, 2021
jasnell
approved these changes
Jan 18, 2021
Landed in cb2535e |
jasnell
pushed a commit
that referenced
this pull request
Jan 18, 2021
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>
ruyadorno
pushed a commit
that referenced
this pull request
Jan 22, 2021
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>
Merged
ruyadorno
pushed a commit
that referenced
this pull request
Jan 25, 2021
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>
targos
pushed a commit
that referenced
this pull request
May 1, 2021
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>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
c++
Issues and PRs that require attention from people who are familiar with C++.
os
Issues and PRs related to the os subsystem.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofsome 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 thevector but doesn't initialize the value since we are anyways doing it in
the following loop.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes