php 执行速度慢,启用Xdebug之后,PHP的运行速度非常慢

资料来源:

https://www.phase2technology.com/blog/profiling-production-whats-slowing-you-down

Instrumentation in interpreted languages, like PHP and Javascript, involves hooking into the runtime and explicitly collecting information about every function call as is occurs. This allows you to view the elapsed time spent, a call graph of function calls in the stack, memory and CPU stats, and other system data about your code as it executes on each request. Instrumented profiling does add overhead however, and it can be significant; this depends on the complexity of your application. This makes instrumented profiling ideal for development and debugging sessions, but limited for ongoing production analysis and monitoring.

仪器的一个很好的替代方案是基于样本的分析.

Sample-based profiling involves taking snapshots of an application at fixed intervals. Each snapshot records the currently-executed function(s), and the aggregate of these snapshots is used to approximate when and where time is being spent in your code. This provides much less detail than instrumented profiling but without the significant added overhead, making it ideal for production use.

请参阅sample_prof以获取使用PHP进行基于样本的分析的示例.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值