Skip to content
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

Propose v6.3.0 #7441

Merged
merged 131 commits into from
Jul 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
929b6c2
src: refactor require('constants')
jasnell May 2, 2016
2a8bd35
src: add node::FreeEnvironment public API
zcbenz Sep 28, 2015
6210528
deps: import v8_inspector
ofrobots May 29, 2016
7d4f038
src,lib: v8-inspector support
pavelfeldman Feb 7, 2016
c1bd3fe
cluster: work with v8_inspector
cjihrig May 20, 2016
ea2d661
src: fix --without-inspector build
addaleax May 31, 2016
643b33b
src: add linebreak to inspector message
nicolasromer May 30, 2016
f4777c7
deps: update v8_inspector
ofrobots Jun 2, 2016
2fd140b
src: fix json payload from inspector
Jun 8, 2016
ec90a7a
inspector: change default port
ofrobots Jun 8, 2016
7da8a41
inspector: reduce implementation in header
Jun 7, 2016
38d36e3
src: fix --without-inspector build
addaleax May 31, 2016
88b2aa3
inspector: process.exit should wait for inspector
Jun 8, 2016
3d69ad1
src: make Sec-WebSocket-Key check case-insensitive
MylesBorins Jun 9, 2016
e1d6bd9
stream: improve Readable.read() performance
mscdex May 31, 2016
fb39025
punycode: update to v2.0.0
mathiasbynens Jun 10, 2016
cbe5747
deps: switch to upstream v8_inspector
ofrobots Jun 14, 2016
09ecd1f
inspector: fix coverity scan errors
Jun 16, 2016
8dd48c9
inspector: fix inspector connection cleanup
Jun 1, 2016
d049919
vm: add ability to break on sigint/ctrl+c
addaleax May 8, 2016
72d659a
readline: return old status from _setRawMode
addaleax May 8, 2016
da8e510
repl: break on sigint/ctrl+c
addaleax May 8, 2016
0593351
src: use RAII for mutexes and condition variables
bnoordhuis Jun 17, 2016
2c7804a
crypto,tls: perf improvements for crypto and tls getCiphers
jasnell Jun 8, 2016
77331a7
tls: avoid calling Buffer.byteLength multiple times
jasnell Jun 8, 2016
9e9d7b8
doc: general improvements to os.md copy
jasnell Jun 3, 2016
7aa2125
doc: add argument information for socket.destroy()
Trott Jun 8, 2016
580e110
test: refresh the tmpdir before using
Trott Jun 16, 2016
c236a13
test: mark test-vm-timeout flaky on windows
Trott Jun 22, 2016
0f434fe
doc: add RReverser to collaborators
RReverser Jun 22, 2016
ec515c5
doc: mention http request "aborted" events
kemitchell Jun 10, 2016
7a0718b
doc: add `added:` information for tls
italoacasas May 27, 2016
32e068a
tools: update certdata.txt
bnoordhuis Jun 22, 2016
3eb02b6
tools: output include guards in mk-ca-bundle.pl
bnoordhuis Jun 22, 2016
ef41c8b
crypto: update root certificates
bnoordhuis Jun 22, 2016
009858b
test: remove internet/test-tls-connnect-cnnic
bnoordhuis Jun 23, 2016
029af2c
doc: update build instructions for Windows
joaocgreis Jun 13, 2016
a04cd85
doc: fix repl defineCommand example
akki Jun 23, 2016
eed6597
doc: fix link in the stream doc
italoacasas Jun 21, 2016
0bbf2ef
test: fix flaky test-fs-watch-encoding on OS X
Trott Jun 22, 2016
962ac37
string_decoder: fix bad utf8 character handling
mscdex Jun 15, 2016
8f1733c
test: add more UTF-8 StringDecoder tests
gagern Jun 16, 2016
09a7c91
doc: update "who to cc in issues" chart
Fishrock123 May 11, 2016
4486ba9
doc: add lance to collaborators
lance Jun 24, 2016
16aff79
test: add test for exec() known issue
Trott Jun 22, 2016
457d244
test: fix flaky test-vm-timeout
addaleax Jun 22, 2016
55b87c0
vm: test for abort condition of current invocation
addaleax Jun 22, 2016
e30f32f
Revert "test: mark test-vm-timeout flaky on windows"
addaleax Jun 22, 2016
6b1fc63
readline: allow passing prompt to constructor
evanlucas Jun 3, 2016
b725437
doc: minor rewording to the GitHub issue/pr templates
Fishrock123 Jun 24, 2016
efce335
doc: add CTC meeting minutes 2016-06-15
joshgav Jun 16, 2016
ca95a84
repl: fix tab completion for defined commands
princejwesley Jun 22, 2016
44bc638
doc: clarify child_process stdout/stderr types
sartrey Jun 22, 2016
e7b8400
http: replace finish() callback with arrow function
originalfoo Jun 22, 2016
35c70b5
benchmark: `util._extend` vs `object.assign`
suryagh Jun 10, 2016
3475591
doc: fix "sign.verify" typo in crypto doc.
rus0000 Jun 24, 2016
5f766ad
doc: fix typographic error in process doc
Trott Jun 26, 2016
a4880b5
deps: `MASM.UseSafeExceptionHandlers` for OpenSSL
indutny Jun 26, 2016
fa9e6f7
crypto: Allow GCM ciphers to have a longer IV length
mwain Apr 25, 2016
84dd526
src: renaming ares_task struct to node_ares_task
danbev Jun 20, 2016
c39f6c0
repl: Enable tab completion for global properties
lance Jun 22, 2016
40211e8
assert: remove unneeded arguments special handling
Trott Jun 24, 2016
225f3b9
deps: update v8_inspector
targos Jun 23, 2016
fe580eb
inspector: print warning when used
evanlucas Jun 23, 2016
bc37e6a
doc: general improvements to timers.md
jasnell May 23, 2016
91744aa
build: configure --shared
stefanmb Mar 27, 2016
1c7b622
doc: add `added:` information for http
addaleax Jun 23, 2016
f269c00
doc: add `added:` information for https
addaleax Jun 23, 2016
58ae35c
doc: fix broken refs to url.parse() in http docs
addaleax Jun 23, 2016
365f520
test: test isFullWidthCodePoint with invalid input
Trott Jun 25, 2016
5830ec5
tools: update cpplint to r456
bnoordhuis Jun 28, 2016
e3662a4
tools: disable unwanted cpplint rules again
bnoordhuis Jun 28, 2016
01b7b9a
tools: add back --mode=tap to cpplint
bnoordhuis Jun 28, 2016
9d0641e
tools: allow cpplint to run outside git repo
bnoordhuis Jun 28, 2016
5dfa234
src: fix build/c++tr1 cpplint warnings
bnoordhuis Jun 28, 2016
6280ccd
src: fix build/header_guard cpplint warnings
bnoordhuis Jun 28, 2016
7fe758d
src: fix readability/braces cpplint warnings
bnoordhuis Jun 28, 2016
b7e006b
src: fix readability/constructors cpplint warnings
bnoordhuis Jun 28, 2016
5fd1585
src: fix readability/inheritance cpplint warnings
bnoordhuis Jun 28, 2016
43e8357
src: fix readability/namespace cpplint warnings
bnoordhuis Jun 28, 2016
1fa6dba
src: fix readability/nolint cpplint warnings
bnoordhuis Jun 28, 2016
88c5183
src: fix runtime/indentation_namespace warnings
bnoordhuis Jun 28, 2016
be0c575
src: fix runtime/int cpplint warnings
bnoordhuis Jun 28, 2016
1b3c1b0
src: fix runtime/references cpplint warnings
bnoordhuis Jun 28, 2016
f72259a
src: fix whitespace/blank_line cpplint warnings
bnoordhuis Jun 28, 2016
3fa643b
src: fix whitespace/indent cpplint warnings
bnoordhuis Jun 28, 2016
8a31b23
build: remove unused files from CPPLINT_FILES
bnoordhuis Jun 28, 2016
da0ebf6
src: lint node_win32_perfctr_provider.cc
bnoordhuis Jun 28, 2016
ca4fb08
src: lint node_lttng_tp.h
bnoordhuis Jun 28, 2016
001aa06
src: lint v8abbr.h
bnoordhuis Jun 28, 2016
e727cb5
tools: fix -Wunused-variable warning
bnoordhuis Jun 28, 2016
a5d8945
timers: optimize linkedlist
Apr 26, 2016
efb7a90
timers: optimize `setImmediate()`
Apr 28, 2016
44f0f94
benchmark: add `setImmediate()` benchmarks
Apr 27, 2016
c795d1e
src: check uv_async_init() return value
bnoordhuis Jun 22, 2016
3b1c19f
src: initialize encoding_ data member
bnoordhuis Jun 22, 2016
9945b4e
src: guard against starting fs watcher twice
bnoordhuis Jun 22, 2016
2228a65
src: remove unused data member write_queue_size_
bnoordhuis Jun 22, 2016
25bc7fe
src: remove unused md_ data members
bnoordhuis Jun 22, 2016
b7e661b
src: remove duplicate HMAC_Init calls
bnoordhuis Jun 22, 2016
2816418
src: remove deprecated HMAC_Init, use HMAC_Init_ex
bnoordhuis Jun 22, 2016
ce039c3
src: fix use-after-return in zlib bindings
bnoordhuis Jun 22, 2016
6fa560d
src: fix memory leak in WriteBuffers() error path
bnoordhuis Jun 22, 2016
8f7baff
src: fix bad logic in uid/gid checks
bnoordhuis Jun 22, 2016
4b0ab5b
test: add testcfg.py to test/abort/
bnoordhuis Jun 19, 2016
c7ab7a3
test: fix abort/test-abort-uncaught-exception
bnoordhuis Jun 19, 2016
6de80fc
test: don't use internal headers in add-on tests
bnoordhuis Jun 20, 2016
6cec90a
src: print backtrace on fatal error
bnoordhuis May 13, 2016
c96d701
src: print backtrace on abort/unreachable code
bnoordhuis May 13, 2016
517e715
test: add abort test for backtrace validation
cjihrig May 16, 2016
b8919b1
src: move ABORT() logic into node::Abort()
bnoordhuis Jun 19, 2016
57cc4e3
src: print backtrace on failed CHECK/ASSERT
bnoordhuis Jun 19, 2016
658ab3d
test: check types for http request and response
bnoordhuis May 26, 2016
d857e9a
tools: explicit path for V8 test tap output
Jun 28, 2016
c4aaf47
inspector: Do cleanups before notifying callback
Jun 27, 2016
12b1993
deps: update icu-small to include punycode datafiles
jasnell Jun 28, 2016
d0e2492
net: use icu's punycode implementation
jasnell Jun 21, 2016
8d18aed
doc: fixing minor typo in AtExit hooks section
danbev Jun 29, 2016
6151544
vm: don't print out arrow message for custom error
addaleax Jun 24, 2016
1bd6a62
build: drop unconditional openssl dep from cctest
bnoordhuis Jun 29, 2016
4891001
debugger: make listen address configurable
bnoordhuis Oct 10, 2015
7a7b8f7
repl: Default `useGlobal` to false in CLI REPL.
lance Mar 14, 2016
4a0fb6f
Revert "child_process: measure buffer length in bytes"
Trott Jun 22, 2016
2aa06b9
child_process: preserve argument type
Trott Jun 23, 2016
7d07a0b
doc: improve usage of `zero`/`0`
Trott Jun 28, 2016
b383fdd
test: remove common.PORT from http tests
Trott Jun 29, 2016
45f83e5
doc: add guide for Node.js Timers
ryanmurakami May 18, 2016
9b5be44
build: split CI rules in Makefile
joaocgreis Jun 15, 2016
6da49ac
test: handle SmartOS bug in test-tls-session-cache
Trott Jun 30, 2016
c132e9c
test: listen on and connect to 127.0.0.1
bnoordhuis Jul 2, 2016
63d361b
doc: fix documentation of process.argv
tarungarg546 Jun 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
Thank you for reporting an issue. Please fill in the template below. If unsure
about something, just do as best as you're able.
Thank you for reporting an issue.
Please fill in as much of the template below as you're able.

Version: usually output of `node -v`
Platform: either `uname -a` output, or if Windows, version and 32 or 64-bit
Version: output of `node -v`
Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)
Subsystem: if known, please specify affected core module name

If possible, please provide code that demonstrates the problem, keeping it as
Expand Down
13 changes: 6 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<!--
Thank you for your pull request. Please review below requirements.

Bug fixes and new features should include tests and possibly a benchmark.
Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md
-->

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] `make -j4 test` (UNIX) or `vcbuild test nosign` (Windows) passes
- [ ] a test and/or benchmark is included
- [ ] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] the commit message follows commit guidelines

- [ ] commit message follows commit guidelines

##### Affected core subsystem(s)
<!-- provide affected core subsystem(s) (like doc, cluster, crypto, etc) -->
<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->


##### Description of change
<!-- provide a description of the change below this comment -->
<!-- Provide a description of the change below this comment. -->
10 changes: 6 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ $ node -e "console.log('Hello from Node.js ' + process.version)"
Prerequisites:

* [Python 2.6 or 2.7](https://www.python.org/downloads/)
* Visual Studio 2013 / 2015, all editions including the Community edition, or
* Visual Studio Express 2013 / 2015 for Desktop
* One of:
* [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
* [Visual Studio](https://www.visualstudio.com/) 2013 / 2015, all editions including the Community edition
* [Visual Studio](https://www.visualstudio.com/) Express 2013 / 2015 for Desktop
* Basic Unix tools required for some tests,
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
Expand All @@ -117,8 +119,8 @@ To run the tests:

To test if Node.js was built correctly:

```
$ node -e "console.log('Hello from Node.js ' + process.version)"
```text
> Release\node -e "console.log('Hello from Node.js', process.version)"
```

### Android / Android-based devices (e.g., Firefox OS)
Expand Down
36 changes: 23 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ ifdef QUICKCHECK
endif

ifdef ENABLE_V8_TAP
TAP_V8 := --junitout v8-tap.xml
TAP_V8_INTL := --junitout v8-intl-tap.xml
TAP_V8_BENCHMARKS := --junitout v8-benchmarks-tap.xml
TAP_V8 := --junitout $(PWD)/v8-tap.xml
TAP_V8_INTL := --junitout $(PWD)/v8-intl-tap.xml
TAP_V8_BENCHMARKS := --junitout $(PWD)/v8-benchmarks-tap.xml
endif

V8_TEST_OPTIONS = $(V8_EXTRA_TEST_OPTIONS)
Expand Down Expand Up @@ -184,11 +184,25 @@ test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node
test-all-valgrind: test-build
$(PYTHON) tools/test.py --mode=debug,release --valgrind

CI_NATIVE_SUITES := addons
CI_JS_SUITES := doctool known_issues message parallel pseudo-tty sequential

# Build and test addons without building anything else
test-ci-native: | test/addons/.buildstamp
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=release --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES)

# This target should not use a native compiler at all
test-ci-js:
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=release --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_JS_SUITES)

test-ci: | build-addons
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=release --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) addons doctool known_issues message pseudo-tty parallel \
sequential
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES) $(CI_JS_SUITES)

test-release: test-build
$(PYTHON) tools/test.py --mode=release
Expand Down Expand Up @@ -299,9 +313,11 @@ docopen: out/doc/api/all.html
docclean:
-rm -rf out/doc

run-ci:
build-ci:
$(PYTHON) ./configure $(CONFIG_FLAGS)
$(MAKE)

run-ci: build-ci
$(MAKE) test-ci

RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
Expand Down Expand Up @@ -671,18 +687,12 @@ jslint-ci:
tools/eslint-rules tools/jslint.js

CPPLINT_EXCLUDE ?=
CPPLINT_EXCLUDE += src/node_lttng.cc
CPPLINT_EXCLUDE += src/node_root_certs.h
CPPLINT_EXCLUDE += src/node_lttng_tp.h
CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
CPPLINT_EXCLUDE += src/queue.h
CPPLINT_EXCLUDE += src/tree.h
CPPLINT_EXCLUDE += src/v8abbr.h
CPPLINT_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)

CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
deps/debugger-agent/include/* \
deps/debugger-agent/src/* \
src/*.c \
src/*.cc \
src/*.h \
Expand Down Expand Up @@ -715,4 +725,4 @@ endif
bench-all bench bench-misc bench-array bench-buffer bench-net \
bench-http bench-fs bench-tls cctest run-ci test-v8 test-v8-intl \
test-v8-benchmarks test-v8-all v8 lint-ci bench-ci jslint-ci doc-only \
$(TARBALL)-headers
$(TARBALL)-headers test-ci test-ci-native test-ci-js build-ci
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ information about the governance of the Node.js project, see
* [joaocgreis](https://github.com/joaocgreis) - **João Reis** &lt;reis@janeasystems.com&gt;
* [julianduque](https://github.com/julianduque) - **Julian Duque** &lt;julianduquej@gmail.com&gt;
* [JungMinu](https://github.com/JungMinu) - **Minwoo Jung** &lt;jmwsoft@gmail.com&gt;
* [lance](https://github.com/lance) - **Lance Ball** &lt;lball@redhat.com&gt;
* [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** &lt;lxe@lxe.co&gt;
* [matthewloring](https://github.com/matthewloring) - **Matthew Loring** &lt;mattloring@google.com&gt;
* [mcollina](https://github.com/mcollina) - **Matteo Collina** &lt;matteo.collina@gmail.com&gt;
Expand All @@ -203,6 +204,7 @@ information about the governance of the Node.js project, see
* [robertkowalski](https://github.com/robertkowalski) - **Robert Kowalski** &lt;rok@kowalski.gd&gt;
* [romankl](https://github.com/romankl) - **Roman Klauke** &lt;romaaan.git@gmail.com&gt;
* [ronkorving](https://github.com/ronkorving) - **Ron Korving** &lt;ron@ronkorving.nl&gt;
* [RReverser](https://github.com/RReverser) - **Ingvar Stepanyan** &lt;me@rreverser.com&gt;
* [saghul](https://github.com/saghul) - **Saúl Ibarra Corretgé** &lt;saghul@gmail.com&gt;
* [sam-github](https://github.com/sam-github) - **Sam Roberts** &lt;vieuxtech@gmail.com&gt;
* [santigimeno](https://github.com/santigimeno) - **Santiago Gimeno** &lt;santiago.gimeno@gmail.com&gt;
Expand Down
20 changes: 20 additions & 0 deletions benchmark/crypto/get-ciphers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1, 5000],
v: ['crypto', 'tls']
});

function main(conf) {
const n = +conf.n;
const v = conf.v;
const method = require(v).getCiphers;
var i = 0;

common.v8ForceOptimization(method);
bench.start();
for (; i < n; i++) method();
bench.end(n);
}
40 changes: 40 additions & 0 deletions benchmark/misc/util-extend-vs-object-assign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use strict';

const common = require('../common.js');
const util = require('util');
const v8 = require('v8');

const bench = common.createBenchmark(main, {
type: ['extend', 'assign'],
n: [10e4]
});

function main(conf) {
let fn;
const n = conf.n | 0;
let v8command;

if (conf.type === 'extend') {
fn = util._extend;
v8command = '%OptimizeFunctionOnNextCall(util._extend)';
} else if (conf.type === 'assign') {
fn = Object.assign;
// Object.assign is built-in, cannot be optimized
v8command = '';
}

// Force-optimize the method to test so that the benchmark doesn't
// get disrupted by the optimizer kicking in halfway through.
for (var i = 0; i < conf.type.length * 10; i += 1)
fn({}, process.env);

v8.setFlagsFromString('--allow_natives_syntax');
eval(v8command);

var obj = new Proxy({}, { set: function(a, b, c) { return true; } });

bench.start();
for (var j = 0; j < n; j += 1)
fn(obj, process.env);
bench.end(n);
}
75 changes: 75 additions & 0 deletions benchmark/net/punycode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
'use strict';

const common = require('../common.js');
const icu = process.binding('icu');
const punycode = require('punycode');

const bench = common.createBenchmark(main, {
method: ['punycode', 'icu'],
n: [1024],
val: [
'افغانستا.icom.museum',
'الجزائر.icom.museum',
'österreich.icom.museum',
'বাংলাদেশ.icom.museum',
'беларусь.icom.museum',
'belgië.icom.museum',
'българия.icom.museum',
'تشادر.icom.museum',
'中国.icom.museum',
'القمر.icom.museum',
'κυπρος.icom.museum',
'českárepublika.icom.museum',
'مصر.icom.museum',
'ελλάδα.icom.museum',
'magyarország.icom.museum',
'ísland.icom.museum',
'भारत.icom.museum',
'ايران.icom.museum',
'éire.icom.museum',
'איקו״ם.ישראל.museum',
'日本.icom.museum',
'الأردن.icom.museum'
]
});

function usingPunycode(val) {
punycode.toUnicode(punycode.toASCII(val));
}

function usingICU(val) {
icu.toUnicode(icu.toASCII(val));
}

function runPunycode(n, val) {
common.v8ForceOptimization(usingPunycode, val);
var i = 0;
bench.start();
for (; i < n; i++)
usingPunycode(val);
bench.end(n);
}

function runICU(n, val) {
common.v8ForceOptimization(usingICU, val);
var i = 0;
bench.start();
for (; i < n; i++)
usingICU(val);
bench.end(n);
}

function main(conf) {
const n = +conf.n;
const val = conf.val;
switch (conf.method) {
case 'punycode':
runPunycode(n, val);
break;
case 'icu':
runICU(n, val);
break;
default:
throw new Error('Unexpected method');
}
}
32 changes: 32 additions & 0 deletions benchmark/streams/readable-bigread.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

const common = require('../common');
const v8 = require('v8');
const Readable = require('stream').Readable;

const bench = common.createBenchmark(main, {
n: [100e1]
});

function main(conf) {
const n = +conf.n;
const b = new Buffer(32);
const s = new Readable();
function noop() {}
s._read = noop;

// Force optimization before starting the benchmark
s.push(b);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(s.read)');
s.push(b);
while (s.read(128));

bench.start();
for (var k = 0; k < n; ++k) {
for (var i = 0; i < 1e4; ++i)
s.push(b);
while (s.read(128));
}
bench.end(n);
}
32 changes: 32 additions & 0 deletions benchmark/streams/readable-bigunevenread.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

const common = require('../common');
const v8 = require('v8');
const Readable = require('stream').Readable;

const bench = common.createBenchmark(main, {
n: [100e1]
});

function main(conf) {
const n = +conf.n;
const b = new Buffer(32);
const s = new Readable();
function noop() {}
s._read = noop;

// Force optimization before starting the benchmark
s.push(b);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(s.read)');
s.push(b);
while (s.read(106));

bench.start();
for (var k = 0; k < n; ++k) {
for (var i = 0; i < 1e4; ++i)
s.push(b);
while (s.read(106));
}
bench.end(n);
}
Loading