Brian White
ce5157b22f
lib: remove usc-2 encoding
...
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 >
2018-07-27 21:03:11 +02:00
MaleDong
a478259af7
test,util: add missing tests and conditions
...
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 >
2018-07-08 12:27:16 -07:00
Anatoli Papirovski
6f6f7f749b
lib: add internal PriorityQueue class
...
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 >
2018-05-22 23:24:37 +04:00
Anatoli Papirovski
b04d0921ae
util: improve spliceOne perf
...
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 >
2018-05-03 14:47:17 +02:00
Ruben Bridgewater
1b6cb94761
benchmark: refactor
...
PR-URL: https://github.com/nodejs/node/pull/18320
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-02-01 10:49:04 +01:00
Ruben Bridgewater
7a24b1c565
benchmark: (util/v8/vm) use destructuring
...
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 >
2018-01-23 01:29:17 +01:00
Sarah Meyer
50fe1a8409
tools, benchmark: test util benchmark
...
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 >
2017-10-28 13:56:44 -07:00
Brian White
d545c948c2
util: use faster -0 check
...
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 >
2017-10-04 03:51:44 -04:00
Timothy Gu
f547db131f
benchmark: add util/type-check
...
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 >
2017-10-01 23:58:59 -03:00
Ruben Bridgewater
e167ab71fb
benchmark: var to const
...
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 >
2017-09-19 21:14:38 -03:00
Ruben Bridgewater
faaefa8082
util: improve format performance
...
PR-URL: https://github.com/nodejs/node/pull/15422
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-09-19 20:05:27 -03:00
Ruben Bridgewater
6bfc439711
benchmark: improve and add more inspect benchmarks
...
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 >
2017-09-14 21:46:25 -03:00
Ruben Bridgewater
95bbb68175
util: improve util.inspect performance
...
* 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 >
2017-08-13 13:52:33 -04:00
Sebastiaan Deckers
bb29405904
lib,src: fix consistent spacing inside braces
...
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 >
2017-07-21 15:13:47 -04:00
Vse Mozhet Byt
e8b8d940d5
benchmark: fix typo in inspect-proxy
...
PR-URL: https://github.com/nodejs/node/pull/14237
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-14 14:21:24 -07:00
Bartosz Sosnowski
ca86aa5323
benchmark: remove forced optimization from util
...
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 >
2017-03-06 16:32:05 +01:00
Joyee Cheung
34bf31ea8a
util: improve readability of normalizeEncoding
...
* 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 >
2017-01-15 20:30:51 +08:00
Rich Trott
566a1513d1
benchmark: reformat code for clarity
...
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 >
2016-11-27 21:51:09 -08:00
Teddy Katz
b1b1978ec5
tools: add additional ESLint rules
...
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 >
2016-09-20 23:21:10 -04:00
James M Snell
ba6196f843
util: fix inspecting of proxy objects
...
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 >
2016-05-03 10:08:24 -07:00
Evan Lucas
735e0df8e4
benchmark: add util.format benchmark
...
PR-URL: https://github.com/nodejs/node/pull/5360
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-03-04 17:27:10 -06:00
Rich Trott
dcfda1007b
tools,benchmark: increase lint compliance
...
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 >
2016-02-27 20:15:17 -08:00
Rich Trott
4bb529d972
benchmark: use strict mode
...
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 >
2016-02-22 11:09:26 -08:00
Jackson Tian
3e740caaf3
util: faster arrayToHash
...
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 >
2015-12-30 11:54:26 -08:00