forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node: improve accessor perf of process.env
Set process.env array entries in JS. PR-URL: nodejs#3780 Reviewed-By: Fedor Indutny <fedor@indutny.com>
- Loading branch information
1 parent
89f056b
commit ecef817
Showing
2 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
n: [1e5], | ||
}); | ||
|
||
|
||
function main(conf) { | ||
const n = conf.n >>> 0; | ||
bench.start(); | ||
for (var i = 0; i < n; i++) { | ||
// Access every item in object to process values. | ||
Object.keys(process.env); | ||
} | ||
bench.end(n); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters