https://github.com/jehy/node-fastest-json-read
Benchmark for fastest reading of json files
https://github.com/jehy/node-fastest-json-read
benchmark json nodejs
Last synced: 2 months ago
JSON representation
Benchmark for fastest reading of json files
- Host: GitHub
- URL: https://github.com/jehy/node-fastest-json-read
- Owner: jehy
- Created: 2020-01-27T18:20:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-30T07:12:18.000Z (over 6 years ago)
- Last Synced: 2025-01-07T21:44:17.210Z (over 1 year ago)
- Topics: benchmark, json, nodejs
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-fastest-json-read
Benchmark for fastest reading of json files
Here we compare fs.readFile with fs.redFileSync and require (without cache).
Currently result look like this on 1000 iterations:
```
require: 835.308ms
readFileSync: 666.151ms
readFileAsync: 1178.361ms
```
So it is clearly better to use readFileSync, if you don't need data cached and if you don't care about blocking
(for example when using tests or on application startup).