您当前所在位置:首页技术分享php下curl与file_get_contents性能对比

php下curl与file_get_contents性能对比

更新:2022-05-23 08:45:09编辑:Story归类:技术分享人气:171

上一篇讲了《php使用curl替代file_get_contents》, 后续贴出了curl和file_get_contents的对比结果,这边除了curl与file_get_contents的性能对比,还包含了他们的性能对比,讲之前看下如下的结果图:

file_get_contents

php下curl与file_get_contents性能对比

curl与file_get_contents性能对比PHP源代码如下:
1829.php

测试访问
http://test.ttlsa.com/html/1829.php
file_get_contents速度:4.2404510975 seconds
curl速度:2.8205530643 seconds

curl比file_get_contents速度快了30%左右,最重要的是服务器负载更低.

转载请注明出处:php下curl与file_get_contents性能对比 http://www.ttlsa.com/html/1829.html

 

成长的对话版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

bash3与bash4数组结构 使用PHP+淘宝IP地址库接口获得IP所属地理位置