当前位置:网站首页>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 !
边栏推荐
- [image fusion] image fusion based on NSST and PCNN with matlab code
- What should I pay attention to after the live broadcast system source code is set up?
- Common coding and encryption in penetration testing
- LeetCode 207:课程表(拓扑排序判断是否成环)
- 第三方软件测试公司如何选择?2022国内软件测试机构排名
- [Proteus] Arduino uno + ds1307+lcd1602 time display
- Virtual machine security disaster recovery construction
- 什么是CC攻击?如何判断网站是否被CC攻击? CC攻击怎么防御?
- timer使用备注
- Étalonnage de la caméra (objectif et principe d'étalonnage)
猜你喜欢

How to connect the Bluetooth headset to the computer and how to connect the win10 computer to the Bluetooth headset
![[wustctf2020] climb](/img/b6/4a0582144c3125e7a0666bbbbfe29d.png)
[wustctf2020] climb

Bjdctf 2020 Bar _ Babystack

使用SystemParametersInfo访问用户界面设置

Session & cookie details

Buuctf misc grab from the doll

MaxCompute远程连接,上传、下载数据文件操作

How to delete / select an input method on your computer

Accessing user interface settings using systemparametersinfo

与(&&)逻辑或(||),动态绑定结合三目运算
随机推荐
bjdctf_2020_babystack
Reconfiguration of nebula integration testing framework based on BDD theory (Part 2)
简单的折射效果
MySQL - three tables (student, course, score) to query the name, number and score of students whose course is mathematics
日期、时间库使用备注
6000多万铲屎官,捧得出一个国产主粮的春天吗?
Dichotomous special training
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
屏幕截图推荐—Snipaste
Alibaba cloud full link data governance
Mysql database recovery case sharing
[learn FPGA programming from scratch -42]: Vision - technological evolution of chip design in the "post Moorish era" - 1 - current situation
[vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence
What is automated testing? What software projects are suitable for automated testing?
[understanding of opportunity -29]: Guiguzi - internal dialogue - five levels of communication with superiors
Win10 build webservice
How to open the soft keyboard in the computer, and how to open the soft keyboard in win10
【Vulhub靶场】】zabbix-SQL注入(CVE-2016-10134)漏洞复现
How to realize high stability and high concurrency of live video streaming transmission and viewing?
[Proteus] Arduino uno + ds1307+lcd1602 time display