Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gabriel Llamas
committed
Oct 6, 2013
1 parent
7b45b07
commit c75f0da
Showing
6 changed files
with
119 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[strings] | ||
s1 = v | ||
s2 = v | ||
|
||
[numbers] | ||
n1 = 1 | ||
n2 = 1 | ||
n3 = 123.123 | ||
n4 = 123.123 | ||
|
||
[arrays] | ||
a1[] = 1 | ||
a1[] = 1 | ||
a1[] = 123.123 | ||
a2[] = 1 | ||
a2[] = 1 | ||
a2[] = 123.123 | ||
|
||
[objects.o1] | ||
a = 1 | ||
b = 1 | ||
c = 123.123 | ||
|
||
[objects.o2] | ||
a = 1 | ||
b = 1 | ||
c = 123.123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
strings: | ||
s1: v | ||
s2: v | ||
numbers: | ||
n1: 1 | ||
n2: 1 | ||
n3: 123.123 | ||
n4: 123.123 | ||
arrays: | ||
a1: | ||
- "1" | ||
- 1 | ||
- 123.123 | ||
a2: | ||
- "1" | ||
- 1 | ||
- 123.123 | ||
objects: | ||
o1: | ||
a: "1" | ||
b: 1 | ||
c: 123.123 | ||
o2: | ||
a: "1" | ||
b: 1 | ||
c: 123.123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"use strict"; | ||
|
||
var speedy = require ("speedy"); | ||
var yaml = require ("js-yaml"); | ||
var properties = require ("../../lib"); | ||
var fs = require ("fs"); | ||
|
||
var propertiesData = fs.readFileSync ("properties", { encoding: "utf8" }); | ||
var yamlData = fs.readFileSync ("yaml", { encoding: "utf8" }); | ||
var options = { sections: true, namespaces: true, json: true }; | ||
|
||
speedy.run ({ | ||
yaml: function (){ | ||
yaml.safeLoad (yamlData); | ||
}, | ||
properties: function (){ | ||
properties.parse (propertiesData, options); | ||
} | ||
}); | ||
|
||
/* | ||
File: yaml-vs-properties.js | ||
Node v0.10.20 | ||
V8 v3.14.5.9 | ||
Speedy v0.0.8 | ||
Benchmarks: 2 | ||
Timeout: 1000ms (1s 0ms) | ||
Samples: 3 | ||
Total time per benchmark: ~3000ms (3s 0ms) | ||
Total time: ~6000ms (6s 0ms) | ||
Higher is better (ops/sec) | ||
yaml | ||
14,565 ± 1.3% | ||
properties | ||
23,653 ± 0.2% | ||
Elapsed time: 6147ms (6s 147ms) | ||
*/ |