Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ind.ie Projects
h2c2
Commits
e67e78e9
Commit
e67e78e9
authored
Oct 30, 2014
by
Aral Balkan
Browse files
Added a test.
parent
15923e89
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
test-array-performance.coffee
0 → 100644
View file @
e67e78e9
#
# 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'
)
test.json
0 → 100644
View file @
e67e78e9
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment