Сравним производительность с fasterjson ^_^
fasterjson - библиотека для работы с JSON на языке C
http://git.oschina.net/calvinwilliams/fasterjson
На моём виртуальном компьютере я провёл тестирование производительности между fasterjson и rapidjson, который считается самым быстрым в мире.
$ ~/exsrc/fasterjson-1.0.0/test_rapidjson $ time ./press_rapidjson ../test/test_big.json 1000000
Прошло 10 секунд
real 0m9.733s
user 0m9.623s
sys 0m0.017s
$ ~/exsrc/fasterjson-1.0.0/test $ time ./press_fasterjson test_big.json 1000000
Прошло 3 секунды
real 0m3.445s
user 0m3.401s
sys 0m0.010s
$ cat test_big.json
{
"root":
{
"leaf": "content",
"sub_branch":
{
"sub_leaf":"sub_content",
"sub_leaf 2":"sub_content 2"
}
},
"root2": "leaf2",
"employees": [
{ "firstName":"John", "lastName":"Doe"},
{ "firstName":"Anna", "lastName":"Smith"},
{ "firstName":"Peter", "lastName":"Jones"}
],
"programmers":[
{"firstName":"Brett","lastName":"McLaughlin","email":"aaaa"},
{"firstName":"Jason","lastName":"Hunter","email":"bbbb"},
{"firstName":"Elliotte","lastName":"Harold","email":"cccc"}
],
"authors":[
{"firstName":"Isaac","lastName":"Asimov","genre":"sciencefiction"},
{"firstName":"Tad","lastName":"Williams","genre":"fantasy"},
{"firstName":"Frank","lastName":"Peretti","genre":"christianfiction"}
],
"musicians":[
{"firstName":"Eric","lastName":"Clapton","instrument":"guitar"},
{"firstName":"Sergei","lastName":"Rachmaninoff","instrument":"piano"}
]
}