forked from pelletier/go-toml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark against other libraries (pelletier#175)
BenchmarkUnmarshalToml-8 1000 1320117 ns/op 450932 B/op 15072 allocs/op BenchmarkUnmarshalBurntSushiToml-8 3000 402897 ns/op 82900 B/op 1761 allocs/op BenchmarkUnmarshalJson-8 20000 66092 ns/op 3536 B/op 101 allocs/op BenchmarkUnmarshalYaml-8 10000 189600 ns/op 44872 B/op 1058 allocs/op
- Loading branch information
Showing
7 changed files
with
733 additions
and
5 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,164 @@ | ||
{ | ||
"array": { | ||
"key1": [ | ||
1, | ||
2, | ||
3 | ||
], | ||
"key2": [ | ||
"red", | ||
"yellow", | ||
"green" | ||
], | ||
"key3": [ | ||
[ | ||
1, | ||
2 | ||
], | ||
[ | ||
3, | ||
4, | ||
5 | ||
] | ||
], | ||
"key4": [ | ||
[ | ||
1, | ||
2 | ||
], | ||
[ | ||
"a", | ||
"b", | ||
"c" | ||
] | ||
], | ||
"key5": [ | ||
1, | ||
2, | ||
3 | ||
], | ||
"key6": [ | ||
1, | ||
2 | ||
] | ||
}, | ||
"boolean": { | ||
"False": false, | ||
"True": true | ||
}, | ||
"datetime": { | ||
"key1": "1979-05-27T07:32:00Z", | ||
"key2": "1979-05-27T00:32:00-07:00", | ||
"key3": "1979-05-27T00:32:00.999999-07:00" | ||
}, | ||
"float": { | ||
"both": { | ||
"key": 6.626e-34 | ||
}, | ||
"exponent": { | ||
"key1": 5e+22, | ||
"key2": 1000000, | ||
"key3": -0.02 | ||
}, | ||
"fractional": { | ||
"key1": 1, | ||
"key2": 3.1415, | ||
"key3": -0.01 | ||
}, | ||
"underscores": { | ||
"key1": 9224617.445991227, | ||
"key2": 1e+100 | ||
} | ||
}, | ||
"fruit": [{ | ||
"name": "apple", | ||
"physical": { | ||
"color": "red", | ||
"shape": "round" | ||
}, | ||
"variety": [{ | ||
"name": "red delicious" | ||
}, | ||
{ | ||
"name": "granny smith" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "banana", | ||
"variety": [{ | ||
"name": "plantain" | ||
}] | ||
} | ||
], | ||
"integer": { | ||
"key1": 99, | ||
"key2": 42, | ||
"key3": 0, | ||
"key4": -17, | ||
"underscores": { | ||
"key1": 1000, | ||
"key2": 5349221, | ||
"key3": 12345 | ||
} | ||
}, | ||
"products": [{ | ||
"name": "Hammer", | ||
"sku": 738594937 | ||
}, | ||
{}, | ||
{ | ||
"color": "gray", | ||
"name": "Nail", | ||
"sku": 284758393 | ||
} | ||
], | ||
"string": { | ||
"basic": { | ||
"basic": "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." | ||
}, | ||
"literal": { | ||
"multiline": { | ||
"lines": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n", | ||
"regex2": "I [dw]on't need \\d{2} apples" | ||
}, | ||
"quoted": "Tom \"Dubs\" Preston-Werner", | ||
"regex": "\u003c\\i\\c*\\s*\u003e", | ||
"winpath": "C:\\Users\\nodejs\\templates", | ||
"winpath2": "\\\\ServerX\\admin$\\system32\\" | ||
}, | ||
"multiline": { | ||
"continued": { | ||
"key1": "The quick brown fox jumps over the lazy dog.", | ||
"key2": "The quick brown fox jumps over the lazy dog.", | ||
"key3": "The quick brown fox jumps over the lazy dog." | ||
}, | ||
"key1": "One\nTwo", | ||
"key2": "One\nTwo", | ||
"key3": "One\nTwo" | ||
} | ||
}, | ||
"table": { | ||
"inline": { | ||
"name": { | ||
"first": "Tom", | ||
"last": "Preston-Werner" | ||
}, | ||
"point": { | ||
"x": 1, | ||
"y": 2 | ||
} | ||
}, | ||
"key": "value", | ||
"subtable": { | ||
"key": "another value" | ||
} | ||
}, | ||
"x": { | ||
"y": { | ||
"z": { | ||
"w": {} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.