summaryrefslogtreecommitdiff
path: root/benchmark/util
Commit message (Collapse)AuthorAgeFilesLines
* benchmark: swap var for let in util benchmarksAlex Ramirez2019-07-305-5/+5
| | | | | | | | | | In benchmark util directory this changes for loops using var to let when it applies for consistency PR-URL: https://github.com/nodejs/node/pull/28867 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Rich Trott <rtrott@gmail.com>
* tools: enable block-scoped-var eslint ruleRoman Reiss2019-05-101-2/+2
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27616 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* benchmark: refactor for consistent styleRich Trott2019-02-062-2/+2
| | | | | | | | | | | | Code in benchmark directory sometimes uses `function () {}` for anonymous callbacks and sometimes uses `() => {}`. Multi-line arrays sometimes have a trailing comma and sometimes do not. Update to always use arrow functions for anonymous callbacks and trailing commas for multiline arrays. PR-URL: https://github.com/nodejs/node/pull/25944 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: add common.binding()cjihrig2018-10-141-2/+1
| | | | | | | | | | | | | | | | Recently, process.binding() was replaced with internalBinding(). However, internalBinding() is not available on older builds of Node, which are often used for benchmarking purposes. This commit adds a common.binding() to the benchmarks to work around the issue. Hopefully, this can be removed in the not too distant future. PR-URL: https://github.com/nodejs/node/pull/23460 Fixes: https://github.com/nodejs/node/issues/23436 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* benchmark: refactor util benchmarksRuben Bridgewater2018-09-078-29/+18
| | | | | | | | | | | This significantly reduces the benchmark runtime. It removes to many variations that do not provide any benefit and reduces the iterations. PR-URL: https://github.com/nodejs/node/pull/22503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
* util: make util binding internalcjihrig2018-09-051-1/+2
| | | | | | | | | | | Refs: https://github.com/nodejs/node/issues/22160 PR-URL: https://github.com/nodejs/node/pull/22675 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: remove usc-2 encodingBrian White2018-07-271-5/+3
| | | | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/21963 PR-URL: https://github.com/nodejs/node/pull/21964 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test,util: add missing tests and conditionsMaleDong2018-07-081-8/+17
| | | | | | | | | | | 1) Add missing unit tests by `ucs-2` in different kinds of cases. 2) Add missing unit tests by `usc-2` in different kinds of cases. 3) Fix a bug:We cannot find `ucs-2` in `case 5`'s `if` condition after `toLowerCase()` PR-URL: https://github.com/nodejs/node/pull/21455 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib: add internal PriorityQueue classAnatoli Papirovski2018-05-221-0/+18
| | | | | | | | | | | | | | An efficient JS implementation of a binary heap on top of an array with worst-case O(log n) runtime for all operations, including arbitrary item removal (unlike O(n) for most binary heap array implementations). PR-URL: https://github.com/nodejs/node/pull/20555 Fixes: https://github.com/nodejs/node/issues/16105 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* util: improve spliceOne perfAnatoli Papirovski2018-05-031-0/+33
| | | | | | | | | | | | | | | Do less variable allocations and reassignments inside spliceOne since it's relied on by some performance sensitive code. PR-URL: https://github.com/nodejs/node/pull/20453 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* benchmark: refactorRuben Bridgewater2018-02-012-6/+3
| | | | | PR-URL: https://github.com/nodejs/node/pull/18320 Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: (util/v8/vm) use destructuringRuben Bridgewater2018-01-232-10/+7
| | | | | | PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* tools, benchmark: test util benchmarkSarah Meyer2017-10-283-2/+11
| | | | | | | | | Create a minimal test for the util benchmark files. PR-URL: https://github.com/nodejs/node/pull/16050 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* util: use faster -0 checkBrian White2017-10-041-1/+5
| | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/15726 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
* benchmark: add util/type-checkTimothy Gu2017-10-011-0/+50
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/15663 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: var to constRuben Bridgewater2017-09-191-3/+3
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/13757 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* util: improve format performanceRuben Bridgewater2017-09-191-20/+15
| | | | | | PR-URL: https://github.com/nodejs/node/pull/15422 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
* benchmark: improve and add more inspect benchmarksRuben Bridgewater2017-09-145-46/+103
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/14881 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* util: improve util.inspect performanceRuben Bridgewater2017-08-131-0/+39
| | | | | | | | | | | | | | | * improve util.inspect performance This is a huge performance improvement in case of sparse arrays when using util.inspect as the hole will simple be skipped. * use faster visibleKeys property lookup * add inspect-array benchmark PR-URL: https://github.com/nodejs/node/pull/14492 Fixes: https://github.com/nodejs/node/issues/14487 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
* lib,src: fix consistent spacing inside bracesSebastiaan Deckers2017-07-213-8/+8
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/14162 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: fix typo in inspect-proxyVse Mozhet Byt2017-07-141-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/14237 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: remove forced optimization from utilBartosz Sosnowski2017-03-061-7/+0
| | | | | | | | | This removes all instances of %OptimizeFunctionOnNextCall from util benchmarks PR-URL: https://github.com/nodejs/node/pull/9615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* util: improve readability of normalizeEncodingJoyee Cheung2017-01-151-0/+65
| | | | | | | | | | * Improve readability of util.normalizeEncoding and add some comments * Add a benchmark for util.normalizeEncoding PR-URL: https://github.com/nodejs/node/pull/10439 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
* benchmark: reformat code for clarityRich Trott2016-11-271-5/+8
| | | | | | | | | | | | | | | Some of the benchmark code can be a little dense. Not *very* hard to read but perhaps harder than it needs to be. These changes (many of them whitespace-only) hopefully improve readability. There are also a few cases of `assert.equal()` that are changed to `assert.strictEqual()`. PR-URL: https://github.com/nodejs/node/pull/9790 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* tools: add additional ESLint rulesTeddy Katz2016-09-201-2/+2
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/8643 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@keybase.io>
* util: fix inspecting of proxy objectsJames M Snell2016-05-031-0/+44
| | | | | | | | | | | | In certain conditions, inspecting a Proxy object can lead to a max call stack error. Avoid that by detecting the Proxy object and outputting information about the Proxy object itself. Fixes: https://github.com/nodejs/node/issues/6464 PR-URL: https://github.com/nodejs/node/pull/6465 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* benchmark: add util.format benchmarkEvan Lucas2016-03-041-0/+40
| | | | | PR-URL: https://github.com/nodejs/node/pull/5360 Reviewed-By: James M Snell <jasnell@gmail.com>
* tools,benchmark: increase lint complianceRich Trott2016-02-271-1/+1
| | | | | | | | | | | | | | In the hopes of soon having the benchmark code linted, this change groups all the likely non-controversial lint-compliance changes such as indentation, semi-colon usage, and single-vs.-double quotation marks. Other lint rules may have subtle performance implications in the V8 currently shipped with Node.js. Those changes will require more careful review and will be in a separate change. PR-URL: https://github.com/nodejs/node/pull/5429 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
* benchmark: use strict modeRich Trott2016-02-221-0/+1
| | | | | | | | | | Apply strict mode to benchmark code. PR-URL: https://github.com/nodejs/node/pull/5336 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* util: faster arrayToHashJackson Tian2015-12-301-0/+15
The `util.format()` is used frequently, make the method faster is better. R-URL: https://github.com/nodejs/node/pull/3964 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>