My PHP application is decoding about 100 json objects each request, I have many requests per secound, and I need to optimize my code. I was wondering if it would be faster to decode one huge json object instead of 100 smaller ones (assuming this big json was made by nesting the small ones). Anyone had similar issue ?
1 Answer
You will nearly have the same performance with your two methods.
Check your requests time execution and response time with Firebug or similar.
After your test, it seems that your big json is slower than multiple mini json.
2 Comments
Aelios
Quite interesting, I don't have you code source, maybe your merge is a huge operation.
Greg Motyl
I don't measure merge operation, I start counting time after merge is done
$data = json_decode($data, true);