diff options
author | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2019-12-13 22:59:37 +0300 |
---|---|---|
committer | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2019-12-22 22:49:26 +0300 |
commit | 8952105e576315fcb15cd4c9399e950bc191e854 (patch) | |
tree | 1583553a4d844867aa0e6c07f4b8c139c2c4a1eb /test | |
parent | 312f3086c21e5c3595909358c54b5e5b9a0d095d (diff) |
src: make --use-largepages a runtime option
Moves the option that instructs Node.js to-remap its static code to
large pages from a configure-time option to a runtime option. This
should make it easy to assess the performance impact of such a change
without having to custom-build.
PR-URL: https://github.com/nodejs/node/pull/30954
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Co-authored-by: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-startup-large-pages.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/parallel/test-startup-large-pages.js b/test/parallel/test-startup-large-pages.js new file mode 100644 index 00000000000..d5589ee547f --- /dev/null +++ b/test/parallel/test-startup-large-pages.js @@ -0,0 +1,29 @@ +'use strict'; + +// Make sure that Node.js runs correctly with the --use-largepages option. + +require('../common'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); + +{ + const child = spawnSync(process.execPath, + [ '--use-largepages=on', '-p', '42' ]); + const stdout = child.stdout.toString().match(/\S+/g); + assert.strictEqual(child.status, 0); + assert.strictEqual(child.signal, null); + assert.strictEqual(stdout.length, 1); + assert.strictEqual(stdout[0], '42'); +} + +{ + const child = spawnSync(process.execPath, + [ '--use-largepages=xyzzy', '-p', '42' ]); + assert.strictEqual(child.status, 9); + assert.strictEqual(child.signal, null); + assert.strictEqual(child.stderr.toString().match(/\S+/g).slice(1).join(' '), + 'invalid value for --use-largepages'); +} + +// TODO(gabrielschulhof): Make assertions about the stderr, which may or may not +// contain a message indicating that mapping to large pages has failed. |