简体   繁体   中英

PHP optimization - json_decode

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM