The first part of my publication received a number of constructive comments that gave impetus to understand the problem in more detail.
Comments to the post suggested, and my further experiments proved that the speed of the functions I consider functions very much depending on the structure of the data that was transferred to them, and on the type of data.
')
The source code of the test, which made the changes slightly revised relative to the first part, but the basis remains the same:
http://pastie.org/242453So, let's take a look at the simplest - what effect the increasing data nesting has on the speed of work:

Each element of the data array was:
:
array ('1234667890', '1234667890', '1234667890', '1234667890', '1234667890');
:
array (array ('1234667890'), array ('1234667890'), array ('1234667890'), array ('1234667890'), array ('1234667890'));
:
array (array (array ('1234667890')),array (array ('1234667890')),array (array ('1234667890')),array (array ('1234667890')),array (array ('1234667890')));
Conclusion 1. As nesting increases, json becomes many times faster than serialize, but the inverse operations are performed almost equally in speed.Next, we consider whole and fractional numbers (the first eight groups of columns in the graph, the labels “int” and “f”).

The data in the array were random numbers from 0 to 100 (1), from 1000 to 10,000 (2), from 100,000 to 1,000,000 (3) and from 1,000,000 to 10,000,000 (4). For the first four columns an integer was taken, for the second four - fractional.
Conclusion 2. On json integers a little faster when packing, and a little slower when unpacking.Conclusion 3. On fractional numbers json is several times faster when packing, and a little slower when unpacking.The most interesting is the last eight groups of columns. There, random elements of 5, 20, 50, and 100 Latin characters (l) and Cyrillic characters in UTF-8 (k) act as elements of the data array.
Conclusion 4. On long Latin lines json is several times slower.Conclusion 5. On the characters UTF-8 json many times faster.In the epilogue I would like to say that all these studies carried more theoretical than practical value - because in each case the data type will be mixed and you will need tests for your data. Plus - we are really talking about such microscopic benefits, the benefits of which can be seen only with VERY large amounts of data.
PS: The first of this story was published on my personal blog, after which I scored enough points in just a few minutes to get into the PHP blog. After that, it was completely incomprehensible for me to get on the first page, which I was incredibly pleased with =)