views:

237

answers:

1

I don't get it, the data produced by json_encode is much more straightforward than serialize and yet both the JSON encode and decode functions are much more slower than the serialize and unserialize counterparts. Why?

+6  A: 

json_encode does string parsing and tons of allocs compared to serialize's memcpy

Have fun in the source if you're really in the mood.

Paul Tarjan