We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67eaa30 commit 27b4b78Copy full SHA for 27b4b78
benchmark/vm/context-global-proxy.js
@@ -0,0 +1,21 @@
1
+'use strict';
2
+
3
+const common = require('../common.js');
4
5
+const bench = common.createBenchmark(main, {
6
+ n: [100000],
7
+});
8
9
+const vm = require('vm');
10
+const script = new vm.Script(`
11
+ globalThis.foo++;
12
+`);
13
+const context = vm.createContext({ foo: 1 });
14
15
+function main({ n }) {
16
+ bench.start();
17
+ for (let i = 0; i < n; i++) {
18
+ script.runInContext(context);
19
+ }
20
+ bench.end(n);
21
+}
0 commit comments