0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

38 Commits

Author SHA1 Message Date
Alex Ramirez
0d1b14ac19 benchmark: swap var for let in url benchmarks
In benchmark url 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>
2019-07-30 09:37:48 -07:00
Ruben Bridgewater
b08a867d60
benchmark,doc,lib: capitalize more comments
PR-URL: https://github.com/nodejs/node/pull/26849
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-27 17:20:06 +01:00
Joyee Cheung
a365bb9cb1
benchmark: pre-generate data set for URL benchmarks
This patch:

- Introduces `common.bakeUrlData` which can be used to pre-generate
  the data set for the URL benchmarks to loop through instead of
  looping over a constant.
- Add the option to use WPT data in benchmarks for better diversity
  in the input
- Add the option to benchmark URL parsing with base URLs (whatwg only)
- Moves the data in `benchmark/fixtures/url-inputs.js` to
  `benchmark/common.js`

PR-URL: https://github.com/nodejs/node/pull/24302
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-20 05:14:34 +08:00
Sergey Golovin
f3257dd3ea
benchmark: fix benchmark for url
Rename different parameters with the same names to make it possible
to run tests for url benchmarks.

PR-URL: https://github.com/nodejs/node/pull/19084
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 03:56:17 +01:00
Weijia Wang
3cef3e61d6 url: reduce deplicated codes in autoEscapeStr
PR-URL: https://github.com/nodejs/node/pull/18613
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-23 15:46:05 +08:00
Ruben Bridgewater
1a8ed225b2
benchmark: (url) refactor
PR-URL: https://github.com/nodejs/node/pull/18320
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-01 10:49:01 +01:00
Ruben Bridgewater
49f5e08188
benchmark: (url) 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:16 +01: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
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
Rich Trott
095c0de94d benchmark,lib,test: use braces for multiline block
For if/else and loops where the bodies span more than one line, use
curly braces.

PR-URL: https://github.com/nodejs/node/pull/13828
Ref: https://github.com/nodejs/node/pull/13623#discussion_r123048602
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-23 14:43:20 -07:00
Vse Mozhet Byt
22aa3d4899 benchmark: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12455
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-20 04:46:37 +03:00
Brian White
b76a350a19 url: avoid instanceof for WHATWG URL
PR-URL: https://github.com/nodejs/node/pull/11690
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-04-04 17:36:37 -07:00
Timothy Gu
c515a985ea url: spec-compliant URLSearchParams parser
The entire `URLSearchParams` class is now fully spec-compliant.

PR-URL: https://github.com/nodejs/node/pull/11858
Fixes: https://github.com/nodejs/node/issues/10821
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-03-21 17:27:11 -07:00
Lucas Lago
3129ba2bae benchmark: remove v8ForceOptimization calls
This removes common.v8ForceOptimization calls from url and vm benchmark
files.

PR-URL: https://github.com/nodejs/node/pull/11908
Fixes: https://github.com/nodejs/node/issues/11895
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-03-21 10:11:36 +01:00
Timothy Gu
d77a7588cf url: spec-compliant URLSearchParams serializer
PR-URL: https://github.com/nodejs/node/pull/11626
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-03-14 13:14:20 -07:00
Bartosz Sosnowski
c5958d20fd benchmark: remove forced optimization from url
This removes all instances of %OptimizeFunctionOnNextCall from url
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:04 +01:00
Timothy Gu
6123ed5b25 benchmark: add USVString conversion benchmark
PR-URL: https://github.com/nodejs/node/pull/11436
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-28 18:39:24 -08:00
Timothy Gu
d4e1eaf43c benchmark: add url.domainTo*()
PR-URL: https://github.com/nodejs/node/pull/11464
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-24 17:49:46 -08:00
Joyee Cheung
7ee95045dd benchmark: clean up legacy url benchmarks
PR-URL: https://github.com/nodejs/node/pull/11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-15 09:12:30 -08:00
Joyee Cheung
d8ac08a62a benchmark: refactor whatwg-url-properties
PR-URL: https://github.com/nodejs/node/pull/11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-15 09:12:25 -08:00
Joyee Cheung
e571fd4f6c benchmark: move url data to fixtures
PR-URL: https://github.com/nodejs/node/pull/11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-15 09:12:16 -08:00
Timothy Gu
781eb90960 benchmark: add url/url-searchparams-sort.js
PR-URL: https://github.com/nodejs/node/pull/11098
Fixes: https://github.com/nodejs/node/issues/10760
Ref: https://github.com/whatwg/url/issues/26
Ref: https://github.com/whatwg/url/pull/199
Ref: https://github.com/w3c/web-platform-tests/pull/4531
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-02-13 20:49:13 -08:00
Joyee Cheung
ab3e0862af benchmark: URLSearchParams v.s. querystring
Add benchmarks to compare the performance between
URLSearchParams and querystring, remove duplicate
benchmarks.

PR-URL: https://github.com/nodejs/node/pull/11170
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-09 22:57:53 +08:00
Joyee Cheung
c6b586de33 benchmark: fix first call to URL in useWHATWG
PR-URL: https://github.com/nodejs/node/pull/11170
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-09 22:57:15 +08:00
Timothy Gu
590626ba11 benchmark: simplify URLSearchParams import
PR-URL: https://github.com/nodejs/node/pull/11111
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
2017-02-03 12:23:30 -08:00
Timothy Gu
98bb65f641
url: improving URLSearchParams
- add some benchmarks for URLSearchParams
- change URLSearchParams backing store to an array
- add custom inspection for URLSearchParams and its iterators

PR-URL: https://github.com/nodejs/node/pull/10399
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-19 11:33:37 -08:00
Joyee Cheung
d4b749b62f benchmark: improve WHATWG URL benchmarks
* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations

PR-URL: https://github.com/nodejs/node/pull/10678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-15 20:26:19 +08:00
Rich Trott
a68987c154 benchmark,lib,test: adjust for linting
Formatting changes for upcoming linter update.

PR-URL: https://github.com/nodejs/node/pull/10561
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-01-06 14:36:01 -08:00
Joyee Cheung
b7fadf0fa4 benchmark: add benchmark for WHATWG URL properties
PR-URL: https://github.com/nodejs/node/pull/10408
Fixes: https://github.com/nodejs/node/issues/10376
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-29 15:46:50 -08:00
James M Snell
4b312387ea url: adding WHATWG URL support
Implements WHATWG URL support. Example:

```
var u = new url.URL('http://example.org');
```

Currently passing all WHATWG url parsing tests and all but two of the
setter tests. The two setter tests are intentionally skipped for now
but will be revisited.

PR-URL: https://github.com/nodejs/node/pull/7448
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-10-11 12:41:42 -07:00
Rich Trott
08ea9ee56d benchmark: add benchmark for url.format()
PR-URL: https://github.com/nodejs/node/pull/7250
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-06-13 16:17:22 -07:00
Andreas Madsen
f6c505d0b1 benchmark: merge url.js with url-resolve.js
url.js was broken since it didn't use the common.js runner. This fixes
that issue by merging it with url-resolve.js, which also benchmarks
url.resolve.

PR-URL: https://github.com/nodejs/node/pull/5177
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-02-26 20:29:05 +11:00
Andreas Madsen
d9079ab801 benchmark: move misc to categorized directories
PR-URL: https://github.com/nodejs/node/pull/5177
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-02-26 20:28:45 +11: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
Ben Noordhuis
aff56cd2b4 lib: micro-optimize url.resolve()
Replace the call to Array#splice() with a faster open-coded version
that creates less garbage.

Add a new benchmark to prove it.  With the change applied, it scores
about 5% higher and that is nothing to sneeze at.

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 21:33:52 +01:00
Ben Noordhuis
6b2af5f0c7 benchmark: rename url.parse() benchmark
Rename the url.parse() benchmark from url.js to url-parse.js.
A follow-up commit is going to add another one for url.resolve().

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 21:33:21 +01:00
Ben Noordhuis
1a63b45a2a benchmark: pre-optimize url.parse() before start
Force V8 to optimize url.parse() before starting the actual benchmark.
Tries to minimize variance between successive runs caused by the
optimizer kicking in at different points.

It does not seem to have much impact, CPU times are roughly the same
before and afterwards; url.parse() quickly plateaus at a local optimum
where most time is spent in V8 builtins, notably Runtime_StringSplit()
and Object::GetElementWithReceiver() calls originating from
deps/v8/src/uri.js, with no recurring optimize/deoptimize cycles that
I could spot.

Still, I don't see any downsides to pre-optimizing the function being
benchmarked so in it goes.

PR-URL: https://github.com/iojs/io.js/pull/132
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-12-19 23:10:31 +01:00
Ben Noordhuis
21a679a10f benchmark: add url benchmarks
Based on the ad-hoc benchmark from joyent/node#8638 plus an additional
benchmark for user:pass auth URLs.

PR-URL: https://github.com/iojs/io.js/pull/102
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-09 22:16:41 +01:00