Score
0
Watch 1 Star 5 Fork 0

宇润 / PharTestPHPMIT

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
Phar 文件枚举、读取、include 简单测试 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

PharTest

一个关于 Phar 文件性能的简单测试,测试内容包括:文件枚举、读取、include 简单测试。

想要启动 Phar 文件打包功能,首先要在php.ini中配置phar.readonly = Off

运行命令:php build-test.php

结论

使用 Phar 进行文件枚举、读取、include,无论是在本地硬盘还是 Samba 等网络文件共享挂载,性能都比零散的文件性能更强。

我的本地测试结果(100个文件):

phar file scan time:0.00013494491577148s
phar file read time:0.0020039081573486s
phar file include time:0.0024368762969971s
file scan time:0.00027203559875488s
file read time:0.011406183242798s
file include time:0.019156932830811s

我连接香港 Samba 测试结果(100个文件):

phar file scan time:0.00029492378234863s
phar file read time:0.0043320655822754s
phar file include time:0.004457950592041s
file scan time:0.15881609916687s
file read time:0.19799590110779s
file include time:0.18012094497681s

Comments ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/yurunsoft/PharTest.git
git@gitee.com:yurunsoft/PharTest.git
yurunsoft
PharTest
PharTest
master

Help Search