https://github.com/ivanhuay/micron-process-env
micron test to measeure process.env performance
https://github.com/ivanhuay/micron-process-env
benchmark micron node
Last synced: about 2 months ago
JSON representation
micron test to measeure process.env performance
- Host: GitHub
- URL: https://github.com/ivanhuay/micron-process-env
- Owner: ivanhuay
- Created: 2019-10-09T13:30:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-09T14:06:10.000Z (over 6 years ago)
- Last Synced: 2025-04-09T01:01:43.950Z (about 1 year ago)
- Topics: benchmark, micron, node
- Language: JavaScript
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Micron Benchmark For process.env performance
This is a benchmark to analize the performance between using only one `process.env` or multiple each time.
## Motivation
In this benchmark we measure the performance variation using `process.env` in this two ways:
```javascript
function pwd(){
return process.env.PWD;
}
```
vs
```javascript
const PWD = process.env.PWD
function pwd(){
return PWD;
}
```
## Results
As expected using the env variable in a const is the best way to use process.env, this is because process.env make a SO call so if we use this always it'll consume some time.
[view results HERE](https://ivanhuay.github.io/micron-process.env/)

## run the test
```
git clone https://github.com/ivanhuay/micron-process-env.git
cd micron-process-env
npm i
npm run test
```
after running that the results should be on the docs folder.
```
google-chrome docs/index.html
open docs/index.html
```