当前位置:网站首页>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 !
边栏推荐
- chrono 使用备注
- Global and Chinese markets for food puffers 2022-2028: Research Report on technology, participants, trends, market size and share
- 什么是CC攻击?如何判断网站是否被CC攻击? CC攻击怎么防御?
- Continue to have a fever. Try the asynchronous operation of dart language. The efficiency is increased by 500%
- 《canvas》之第3章 曲线图形
- [WUSTCTF2020]alison_ likes_ jojo
- Global and Chinese market of water massage column 2022-2028: Research Report on technology, participants, trends, market size and share
- Hubei College Upgraded to undergraduate - Hushi family planning department
- Detailed explanation of C language compilation, link and operation
- Unity 的序列化
猜你喜欢

与(&&)逻辑或(||),动态绑定结合三目运算

【NILM】非入侵式负荷分解模块nilmtk安装教程

Analog display of the module taking software verifies the correctness of the module taking data, and reversely converts the bin file of the lattice array to display

Bjdctf 2020 Bar _ Babystack
![[OGeek2019]babyrop](/img/74/5f93dcee9ea5a562a7fba5c17aab76.png)
[OGeek2019]babyrop

爬虫基础B1——Scrapy(B站学习笔记)
![(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]](/img/33/d601a6f92b1b73798dceb027263223.png)
(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]
![选择器(>,~,+,[])](/img/7e/2becfcf7a7b2e743772deee5916caf.png)
选择器(>,~,+,[])

Camera calibration (calibration purpose and principle)

bjdctf_2020_babystack
随机推荐
[MySQL usage Script] clone data tables, save query data to data tables, and create temporary tables
Pyhton crawls to Adu (Li Yifeng) Weibo comments
get_ started_ 3dsctf_ two thousand and sixteen
Commandes de console communes UE
Only two lines are displayed, and the excess part is displayed with Ellipsis
【Django中运行scrapy框架,并将数据存入数据库】
bjdctf_2020_babystack
Wechat cloud hosting hot issues Q & A
[WUSTCTF2020]alison_ likes_ jojo
bjdctf_ 2020_ babystack
bjdctf_2020_babystack
选择器(>,~,+,[])
Climbing 10000 NASA pictures about Mars exploration, I found a secret
What industries and scenarios can the easynvr/easygbs/easycvr platform developed by tsingsee green rhino video be used in?
Selector (>, ~, +, [])
湖北专升本-湖师计科
Étalonnage de la caméra (objectif et principe d'étalonnage)
智能指针备注
Lend you a pair of insight, Frida native trace
How to realize multi protocol video capture and output in video surveillance system?