ItslikeJSON. butfastandsmall. This sentence attracted me and I took a look. Official Website: msgpack.org official installation method dumb, msgpack directory does not have php Directory at all... only see csharp, erlang, go, java, ruby and other directories. Reference gitclonegithub. commsgpackmsgpack. gitcdmsgpa
Its like JSON. but fast and small. This sentence attracted me and I took a look. Official Website: http://msgpack.org official installation method dumb people, msgpack directory does not php Directory at all... only see csharp, erlang, go, java, ruby and other directories. Reference git clone https://github.com/msgpack/msgpack.git cd msgpa
It's like JSON. but fast and small.
This sentence attracted me and gave me a look.
Official Website: http://msgpack.org
The official installation method is confusing. There is no php Directory under the msgpack directory... only the directories such as csharp, erlang, go, java, and ruby are displayed.
Reference
Git clone https://github.com/msgpack/msgpack.git
Cd msgpack/php
Phpize
./Configure & make install
Still found in PHP official website Extension: http://pecl.php.net/package/msgpack
Last Updated:, yesterday's version.
Installation Process:
Wget http://pecl.php.net/get/msgpack-0.5.2.tgz
Tar zxf msgpack-0.5.2.tgz
Cd msgpack-0.5.2
/Usr/local/hx/php/bin/phpize
./Configure -- with-php-config =/usr/local/hx/php/bin/php-config
Make & make install
Add msgpack. so to php. ini, restart php, and complete the installation.
Start test:
$ Data = array (0 => 'abcdefhijklmnopqrstuvwxy', 1 => 'xiamen ', 'abc' => '123 ');
Msgpack_pack, json_encode, and serialize are respectively set to 50, 62, and 87.
Then execute the command 10000 times, respectively. The time consumed is 9.95 milliseconds, 17.45 milliseconds, and 8.85 milliseconds.
Unlocks 10000 executions, time consumed: 14.76 milliseconds, 23.93 milliseconds, 14.61 milliseconds
Msgpack has a performance of at least over json50%. Although it is similar to the speed of serialize, the space occupied by serialize is much higher.
In addition, the GBK program is convenient. msgpack_pack can also be used in Chinese. If json is used, it must be converted to UTF-8 in batches before json_encode can be used.
Tags-php, json