-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
benchmark: add benchmark for object properties #10949
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
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value`
nodejs-github-bot
added
benchmark
Issues and PRs related to the benchmark subsystem.
lts-watch-v6.x
labels
Jan 22, 2017
Results with current versions: # v8.0.0-pre
$ ./node benchmark/misc/object-property-bench.js
misc/object-property-bench.js millions=1000 method="property": 1,132.5729019905275
misc/object-property-bench.js millions=1000 method="string": 1,132.659171573988
misc/object-property-bench.js millions=1000 method="variable": 1,135.7484620810199
misc/object-property-bench.js millions=1000 method="symbol": 1,137.1793635505953
# Now using node v7.4.0 (npm v4.0.5)
$ node benchmark/misc/object-property-bench.js
misc/object-property-bench.js millions=1000 method="property": 1,136.5219151213475
misc/object-property-bench.js millions=1000 method="string": 1,136.0132317913663
misc/object-property-bench.js millions=1000 method="variable": 1,137.077082457694
misc/object-property-bench.js millions=1000 method="symbol": 1,135.8285965589414
# Now using node v6.9.4 (npm v3.10.10)
$ node benchmark/misc/object-property-bench.js
misc/object-property-bench.js millions=1000 method="property": 1,136.9333640080988
misc/object-property-bench.js millions=1000 method="string": 1,137.4697778972075
misc/object-property-bench.js millions=1000 method="variable": 1,139.3569692351732
misc/object-property-bench.js millions=1000 method="symbol": 1,144.1529516480275
# Now using node v4.7.2 (npm v2.15.11)
$ node benchmark/misc/object-property-bench.js
misc/object-property-bench.js millions=1000 method="property": 1,136.765490715278
misc/object-property-bench.js millions=1000 method="string": 1,137.4072967414688
misc/object-property-bench.js millions=1000 method="variable": 78.51823908746029
misc/object-property-bench.js millions=1000 method="symbol": 79.12821605254518 |
lpinca
approved these changes
Jan 22, 2017
jasnell
approved these changes
Jan 23, 2017
cjihrig
approved these changes
Jan 23, 2017
Landed in ad6e778 |
targos
added a commit
that referenced
this pull request
Jan 27, 2017
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value` PR-URL: #10949 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
evanlucas
pushed a commit
that referenced
this pull request
Jan 31, 2017
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value` PR-URL: #10949 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Merged
jasnell
pushed a commit
that referenced
this pull request
Mar 8, 2017
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value` PR-URL: #10949 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
jasnell
pushed a commit
that referenced
this pull request
Mar 8, 2017
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value` PR-URL: #10949 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 9, 2017
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value` PR-URL: #10949 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
Mar 9, 2017
Adds a benchmark to compare the speed of property setting/getting in four cases: - Dot notation: `obj.prop = value` - Bracket notation with string: `obj['prop'] = value` - Bracket notation with string variable: `obj[prop] = value` - Bracket notation with Symbol variable: `obj[sym] = value` PR-URL: #10949 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a benchmark to compare the speed of property setting/getting in
four cases:
obj.prop = value
obj['prop'] = value
obj[prop] = value
obj[sym] = value
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
benchmark