Commit e67e78e9 authored by Aral Balkan's avatar Aral Balkan
Browse files

Added a test.

parent 15923e89
#
# Just a quick test to make sure there are no performance overheads from reading in a large JSON array.
# (There aren’t.)
#
randomWord = require 'random-word'
fs = require 'fs'
a = []
s = Date.now()
for i in [1..64000]
a.push randomWord()
e = Date.now()
fs.writeFileSync 'test.json', JSON.stringify(a)
console.log('Generate + write took: ' + (e-s) + ' ms')
s = Date.now()
b = JSON.parse(fs.readFileSync 'test.json')
e = Date.now()
console.log('Read + parse took: ' + (e-s) + ' ms')
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment