当前位置:网站首页>Detailed explanation of PHP data serialization test example
Detailed explanation of PHP data serialization test example
2022-06-24 07:42:00 【User 2323866】
php Detailed explanation of data serialization test examples Test code
$msg = ['test'=>23]; $start = microtime(true); for($i=0;$i<100000;$i++){ $packMsg = msgpack_pack($msg); } echo 'pack len:'.strlen($packMsg)."rn"; $end = microtime(true); echo 'run time:'.($end-$start).'s'."rn"; echo 'memory usage:'.(memory_get_usage()/1024)."KBrn"; /* $start = microtime(true); for($i=0;$i<100000;$i++){ $jsonMsg = json_encode($msg); } echo 'json len:'.strlen($jsonMsg)."rn"; $end = microtime(true); echo 'run time:'.($end-$start).'s'."rn"; echo 'memory usage:'.(memory_get_usage()/1024)."KBrn";
$start = microtime(t/【php course _linux Common commands _ Network operation and maintenance technology 】/rue); for($i=0;$i<100000;$i++){ $packMsg = serialize($msg); } echo 'php len:'.strlen($packMsg)."rn"; $end = microtime(true); echo 'run time:'.($end-$start)."srn"; echo 'memory usage:'.(memory_get_usage()/1024)."KBrn";*/
Execution results
pack len:7 run time:0.024219989776611s memory usage:354.4765625KB json len:11 run time:0.010890007019043s memory usage:354.1796875KB php len:22 run time:0.010586977005005s memory usage:353.8828125KB
Analyze comments The basic results of online search are ( Estimation is php7 Previous versions )
Running speed serialize<json<msgpack length serialize>json>msgpack Memory consumption serialize<json<msgpack // But almost the same
stay php7 Running in , The results are as follows
Running speed serialize<msgpack<json // There's a change here length serialize>json>msgpack Memory consumption serialize<json<msgpack // But almost the same
That's all php Explanation of data serialization test , If you have any questions, please leave a message or go to our community to exchange and discuss /【 Some of this PHP The version may be a previous one , If it doesn't have to be , Suggest PHP Use as much as possible 7.2 Version above 】/, Thank you for reading , I hope I can help you , Thank you for your support !
边栏推荐
- jarvisoj_level2
- [GUET-CTF2019]zips
- duilib 显示内存图片
- The first common node of two linked lists_ The entry of the link in the linked list (Sword finger offer)
- [tips] use the deep learning toolbox of MATLAB deepnetworkdesigner to quickly design
- L2TP connection failure guide in VPN
- 只显示两行,超出部分省略号显示
- (cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]
- [learn FPGA programming from scratch -41]: vision chapter - Moore's era and Moore's law and the arrival of the post Moore Era
- L2tp/ipsec one click installation script
猜你喜欢

Win11 points how to divide disks? How to divide disks in win11 system?
![[signal recognition] signal modulation classification based on deep learning CNN with matlab code](/img/0b/7475cd4cf2ddce912816ab3c29b914.png)
[signal recognition] signal modulation classification based on deep learning CNN with matlab code

jarvisoj_ level2

相機標定(標定目的、原理)
![[GUET-CTF2019]zips](/img/79/22ff5d4a3cdc3fa9e0957ccc9bad4b.png)
[GUET-CTF2019]zips
![buuctf misc [UTCTF2020]docx](/img/e4/e160f704d6aa754e85056840e14bd2.png)
buuctf misc [UTCTF2020]docx
![[WUSTCTF2020]alison_likes_jojo](/img/a9/dcc6f524772cd0b8781289cbaef63f.png)
[WUSTCTF2020]alison_likes_jojo

阿里云全链路数据治理

Dichotomous special training

Ultra wideband pulse positioning scheme, UWB precise positioning technology, wireless indoor positioning application
随机推荐
Shader 常用函数
LeetCode 515 在每个数行中找最大值[BFS 二叉树] HERODING的LeetCode之路
get_started_3dsctf_2016
相机标定(标定目的、原理)
Global and Chinese market of water massage column 2022-2028: Research Report on technology, participants, trends, market size and share
[OGeek2019]babyrop
简单的折射效果
[WUSTCTF2020]alison_likes_jojo
Group policy disables command prompt bypass
How to select a third-party software testing company? 2022 ranking of domestic software testing institutions
【Vulhub靶场】】zabbix-SQL注入(CVE-2016-10134)漏洞复现
Global and Chinese market of anion sanitary napkins 2022-2028: Research Report on technology, participants, trends, market size and share
第三方软件测试公司如何选择?2022国内软件测试机构排名
[从零开始学习FPGA编程-42]:视野篇 - 后摩尔时代”芯片设计的技术演进-1-现状
Accessing user interface settings using systemparametersinfo
[DDCTF2018](╯°□°)╯︵ ┻━┻
Buuctf misc grab from the doll
What should I pay attention to after the live broadcast system source code is set up?
buuctf misc [UTCTF2020]docx
[pointnet] matlab simulation of 3D point cloud target classification and recognition based on pointnet