
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Portable docker image with PHP 7.3 and tideways extension installed.
Profiling is started automatically with auto_prepend_file configuration.
docker run --rm -v $(pwd):/code phperf/php-profiler php test_me.php
You can also generate SVG call graph adding SVG=1 ENV var (may take long time for big profiles)
docker run --rm -e SVG=1 -v $(pwd):/code phperf/php-profiler php test_me.php
After your script is finished xhprof report and SVG graph will be saved:
Performance index: 0.00037335238456726 Nodes in report: 33 Saving report to xhprof_report.1518411787.448.serialized Generating dot script Generating dot image Saving graph to xhprof_report.1518411787.448.serialized.svg
You can analyze profiling report with https://github.com/phperf/xh-tool
xh-tool top xhprof_report.1518411787.448.serialized --limit 5 --strip-nesting name wallTime wallTime% wallTime1 ownTime ownTime% ownTime1 count PerformanceIndex::euler 1.22s 65.55 9.1us 1.22s 65.55 9.1us 135K PerformanceIndex::measure 1.87s 99.94 1.87s 427.62ms 22.89 427.62ms 1 PerformanceIndex::checkParts 62.24ms 3.33 4.1us 62.24ms 3.33 4.1us 15K md5 43.53ms 2.33 4.4us 43.53ms 2.33 4.4us 10K preg_match 23.71ms 1.27 4.7us 23.71ms 1.27 4.7us 5K
Or you can upload report to https://blackfire.io (blackfire cli tool needed) for analysis
blackfire upload xhprof_report.1517989322.4259.serialized
Blackfire upload completed Graph URL https://blackfire.io/profiles/bec67f2b-b1eb-459f-b392-97a69ea025d9/graph No tests! Create some now https://blackfire.io/docs/cookbooks/tests No recommendations Wall Time 314ms CPU Time 308ms I/O Time 5.31ms Memory 47.4KB Network n/a n/a - SQL n/a -
If you want to save profile data to a particular file, you can provide it with REPORT=<name>, you can use JSON format if name ends with .json
docker run --rm -e REPORT=rep.json -v $(pwd):/code phperf/php-profiler php t2.php Nodes in report: 12 Saving report to rep.json
phperf/php-profiler:latest PHP 7.3, tideways 4.1.7, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.tideways_v4_php73phperf/php-profiler:7.3-tideways-v4 PHP 7.3, tideways 4.1.7, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.tideways_v4_php73phperf/php-profiler:7.3-tideways-v5 PHP 7.3, tideways 5.0-beta3, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.tideways_v5_php73phperf/php-profiler:7.2-tideways-v4 PHP 7.2, tideways 4.1.7, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.tideways_v4_php72phperf/php-profiler:7.2-tideways-v5 PHP 7.2, tideways 5.0-beta3, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.tideways_v5_php72phperf/php-profiler:5.6-xhprof PHP 5.6, xhprof 0.9.4, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.xhprof_php56phperf/php-profiler:5.6-uprofiler PHP 5.6, uprofiler, https://github.com/phperf/profiler-docker/blob/master/Dockerfile.uprofiler_php56您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务