Commit Graph

23 Commits

Author SHA1 Message Date
Livia Medeiros
fcf5de008a
benchmark: use tmpdir.resolve()
PR-URL: https://github.com/nodejs/node/pull/49137
Refs: https://github.com/nodejs/node/pull/49079
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2023-08-30 09:55:20 +00:00
Antoine du Hamel
9e5d1af3ea
benchmark: add trailing commas in benchmark/fs
PR-URL: https://github.com/nodejs/node/pull/46426
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2023-02-01 19:16:18 +00:00
Rich Trott
776d0b4e62 benchmark: enable no-empty ESLint rule
PR-URL: https://github.com/nodejs/node/pull/41831
Refs: https://eslint.org/docs/rules/no-empty
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-05 12:58:27 +00:00
Daniele Belardi
0f8941962d benchmark: use let and const instead of var
Use let and const in domain, es, events, fixtures, fs, http,
http2 and misc.

PR-URL: https://github.com/nodejs/node/pull/31518
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 19:59:41 -08:00
João Reis
0376b5b7ba benchmark: use test/common/tmpdir consistently
Many benchmarks use test/common/tmpdir. This changes 3 benchmarks that
use NODE_TMPDIR to also use test/common/tmpdir.

This is necessary in preparation for the next commit that changes tmpdir
to delete tmpdir.path when the Node.js process exits. Thus, if multiple
benchmarks are run sequentially, the ones that use tmpdir will remove
the directory and the ones changed here would fail because it does not
exist. This happens when running test/benchmark.

Note: to explicitly select a directory for tmpdir, use NODE_TEST_DIR.

PR-URL: https://github.com/nodejs/node/pull/28858
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-08-10 19:21:35 -07:00
Ruben Bridgewater
f86f5736da
benchmark,lib: change var to const
Refs: https://github.com/nodejs/node/pull/26679

PR-URL: https://github.com/nodejs/node/pull/26915
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-03-30 13:16:39 +01:00
Ruben Bridgewater
9edce1e12a
benchmark,doc,lib,test: capitalize comments
This updates a lot of comments.

PR-URL: https://github.com/nodejs/node/pull/26223
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-02-28 18:31:10 +01:00
Rich Trott
29e74d4952 benchmark: refactor for consistent style
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>
2019-02-06 22:18:31 -08:00
cjihrig
5407690bd7
benchmark: remove unused catch bindings
PR-URL: https://github.com/nodejs/node/pull/24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
2018-11-06 10:59:23 -05: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
7e03ffcc12
benchmark: (fs) 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:29 +01:00
Anatoli Papirovski
b43a496092
benchmark: fix timeout in write-stream-throughput
PR-URL: https://github.com/nodejs/node/pull/17958
Fixes: https://github.com/nodejs/node/issues/17901
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-01-05 01:00:20 +01:00
Rich Trott
d610fad390
benchmark: make temp file path configurable
In three fs benchmarks, a temp file is created in the source tree. For
tests, allow the location to be configurable so it gets written to the
test temp directory instead.

Additionally, shave about a second off the test running time by setting
`dur` to `0.1` instead of `1`.

PR-URL: https://github.com/nodejs/node/pull/17811
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-12-24 09:21:37 -05:00
Rich Trott
cfda245706 benchmark: use unique filenames in fs benchmarks
Use a unique file name for each benchmark. Running benchmarks
simultaneously may be a bit of an unusual use case, but there are use
cases, such as stress testing `test/parallel/test-benchmark-fs.js`.

PR-URL: https://github.com/nodejs/node/pull/16776
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-17 21:08:17 -08:00
Charlie Duong
58d26e2421 test: added fs benchmark test
Modified fs benchmarks to use more unique args to avoid collision.

PR-URL: https://github.com/nodejs/node/pull/16049
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2017-10-10 22:59:09 -07: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
Vse Mozhet Byt
74dc3bfe08 benchmark: replace [].join() with ''.repeat()
Also add a benchmark to compare both ways to create strings.

PR-URL: https://github.com/nodejs/node/pull/12170
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-04 09:19:18 -07:00
James M Snell
85ab4a5f12 buffer: add .from(), .alloc() and .allocUnsafe()
Several changes:

* Soft-Deprecate Buffer() constructors
* Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`
* Add `--zero-fill-buffers` command line option
* Add byteOffset and length to `new Buffer(arrayBuffer)` constructor
* buffer.fill('') previously had no effect, now zero-fills
* Update the docs

PR-URL: https://github.com/nodejs/node/pull/4682
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2016-03-16 08:34:02 -07: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
Matthew Aynalem
c171c490f2 fixes #6031 spelling errors
explictly => explicitly
accesss => access
througput => throughput
epxression => expression
communiction => communication
becuase => because
repersent => represent
condonitions => conditions
decompresion => decompression
intentially => intentionally
eventes => events
listning => listening
resicved => received
becuase => because
fundimental => fundamental
colapse => collapse
privlages => privileges
sufficently => sufficiently
hapepns => happens
expliclitly => explicitly
thier => their
shold => should
2013-08-19 16:42:16 -07:00
isaacs
4b80f217cd bench: Simplify duration arguments to benchmarks
For throughput benchmarks, run with just 5s durations rather than 1s and 3s.

For startup benchmark, run with just a single 1s duration, since it's very
consistent anyway.
2013-02-19 17:16:55 -08:00
isaacs
2a64edb025 bench: Add fs write stream throughput 2013-02-19 14:14:36 -08:00