Skip to content
This repository was archived by the owner on Feb 19, 2022. It is now read-only.

Commit 10d0ca0

Browse files
dittosdivmain
authored andcommitted
Reduce overhead accessing process.env in benchmark
1 parent 071146a commit 10d0ca0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

benchmark/benchmark.js

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { render } from "../src";
66
import { time } from "./_util";
77

88

9+
// Accessing process.env.NODE_ENV is expensive.
10+
// Replace process.env to equivalent plain JS objects.
11+
process.env = Object.assign({}, process.env);
12+
913
// Make sure React is in production mode.
1014
process.env.NODE_ENV = "production";
1115

0 commit comments

Comments
 (0)