-
Notifications
You must be signed in to change notification settings - Fork 42
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
Jul 24, 2013
1 parent
9e0c160
commit 52584d0
Showing
17 changed files
with
621 additions
and
456 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 @@ | ||
node_modules |
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,2 @@ | ||
- Se elimina "load()" y "store()" y "parse()" y "stringify()" leen o escriben | ||
a archivo usando el parámetro "path". |
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,42 @@ | ||
"use strict"; | ||
|
||
var speedy = require ("speedy"); | ||
var fs = require ("fs"); | ||
var ini = require ("ini"); | ||
var properties = require ("../lib"); | ||
|
||
var data = fs.readFileSync ("properties", { encoding: "utf8" }); | ||
|
||
speedy.run ({ | ||
ini: function (){ | ||
ini.parse (data); | ||
}, | ||
properties: function (){ | ||
properties.parse (data, { sections: true }); | ||
} | ||
}); | ||
|
||
//Note: ini doesn't convert the values to numbers | ||
|
||
/* | ||
File: ini-vs-properties.js | ||
Node v0.10.13 | ||
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) | ||
ini | ||
24,815 ± 0.3% | ||
properties | ||
22,449 ± 0.2% | ||
Elapsed time: 6140ms (6s 140ms) | ||
*/ |
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", | ||
"s3": "v", | ||
"s4": "v", | ||
"s5": "v" | ||
}, | ||
"numbers": { | ||
"n1": 1, | ||
"n2": 1, | ||
"n3": 1, | ||
"n4": 123.123, | ||
"n5": 123.123, | ||
"n6": 123.123 | ||
}, | ||
"arrays": { | ||
"a1": ["1", 1, 123.123] | ||
}, | ||
"objects": { | ||
"o1": { | ||
"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 properties = require ("../lib"); | ||
var fs = require ("fs"); | ||
|
||
var jsonData = fs.readFileSync ("json", { encoding: "utf8" }); | ||
var propertiesData = fs.readFileSync ("properties", { encoding: "utf8" }); | ||
|
||
speedy.run ({ | ||
json: function (){ | ||
JSON.parse (jsonData); | ||
}, | ||
properties: function (){ | ||
properties.parse (propertiesData, { sections: true, json: true }); | ||
} | ||
}); | ||
|
||
//Note: JSON.parse is written in native by the people that made the V8 engine! | ||
|
||
/* | ||
File: json-vs-properties.js | ||
Node v0.10.13 | ||
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) | ||
json | ||
374,519 ± 0.0% | ||
properties | ||
21,360 ± 0.2% | ||
Elapsed time: 6131ms (6s 131ms) | ||
*/ |
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,24 @@ | ||
[strings] | ||
s1 = v | ||
s2 = v | ||
s3 = v | ||
s4 = v | ||
s5 = v | ||
|
||
[numbers] | ||
n1 = 1 | ||
n2 = 1 | ||
n3 = 1 | ||
n4 = 123.123 | ||
n5 = 123.123 | ||
n6 = 123.123 | ||
|
||
[arrays] | ||
a1 = ["1", 1, 123.123] | ||
a2 = ["1", 1, 123.123] | ||
a3 = ["1", 1, 123.123] | ||
|
||
[objects] | ||
o1 = { "a": "1", "b": 1, "c": 123.123 } | ||
o2 = { "a": "1", "b": 1, "c": 123.123 } | ||
o3 = { "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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
"use strict"; | ||
|
||
module.exports.parse = require ("./parse"); | ||
module.exports.stringify = require ("./stringify"); | ||
module.exports = { | ||
parse: require ("./read"), | ||
stringify: require ("./write") | ||
}; |
Oops, something went wrong.