简体   繁体   English

如何加快PHP依赖

[英]How to speed up PHP Depend

I'm running PHP Depend on our code base to profile the PHP. 我正在运行PHP依赖我们的代码库来分析PHP。 It's a large code base, and I have been disappointed by how long it is taking to iterate through all of the files: days. 它是一个庞大的代码库,我对迭代所有文件需要多长时间感到失望:天。

It's an internal server, but pdepend has sucked up all of the available memory and is constantly swapping. 它是一个内部服务器,但是pdepend已经吸收了所有可用的内存并且不断交换。 Is there a config setting I can set to get PHP Depend to dump data out of memory? 是否有配置设置我可以设置让PHP Depend转储数据内存? Are there any suggestions on getting this to speed up? 有什么建议让这个加快?

Might I suggest a profiling tool: XHProf & XHGui . 我可以建议一个分析工具: XHProfXHGui The former is a profiler you can run in production, the latter is a GUI you can use to visualize the information you've received. 前者是您可以在生产中运行的分析器,后者是一个GUI,您可以使用它来可视化您收到的信息。 Since PHP Depend seems to be written in PHP it would be pretty effective at determining what the code is up to. 由于PHP Depend似乎是用PHP编写的,因此在确定代码的用途方面非常有效。

pDepend does scan and analysis on every line of every file of supplied paths. pDepend对所提供路径的每个文件的每一行进行扫描和分析。 And it does get very slow in bigger code base. 它在更大的代码库中确实变得非常慢。 Since it runs on command line process, APC cache won't help either. 由于它在命令行进程上运行,因此APC缓存也无济于事。 One approach would be divide your code into modules with separate pDepend reports but if you use common library in all modules, reports would not be very accurate. 一种方法是将代码划分为具有单独pDepend报告的模块,但如果在所有模块中使用公共库,则报告将不是非常准确。

Latest pDepend has some performance improvements if you are using older one. 如果您使用旧版本,最新的pDepend会有一些性能提升。 http://pdepend.org/news/pdepend-1.0.0-released.html http://pdepend.org/news/pdepend-1.0.0-released.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM