PHP8与PHP7计算性能对比
2022-07-28 15:20:24
95
{{single.collect_count}}

随着php最新版本的发布,给php带来了巨大性能提升,主要是增加了JIT及时编译的支持,以下是计算性能的测试,并发性能还未进行测试。

$start = microtime(true);$sum = 0;for ($i = 0; $i < 10000000000; $i++) {$sum += $i;}$end = microtime(true);echo $end - $start;
php7.2耗时164s
php8.0耗时60s

从上面的结果看来性能的提升还是很大的

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}