php命名空间基准 [英] php namespace benchmark
问题描述
使用命名空间会使网站更快还是更慢?这是我想知道的。
Does using namespaces make a site faster or slower? That's what I would like to know.
如果它有助于提高网站性能,那么我想立即开始使用它。但是如果它降级了,那么我不想使用它 - 即使一个小的性能在我的项目中有很大的不同。
If it helps improving site performance, then i would like to start using it right now. But if it degrades it, then i don't want to use it at all - even a little performance makes big difference in my project.
任何人都有基准这个?你的意见是什么?
Dos anyone have a benchmark on this? What are your views?
推荐答案
PHP命名空间在很大程度上与网站的性能完全无关。他们帮助你编写封装好和结构化的代码 - 这就是为什么你不应该害怕使用它们,至少如果你的项目达到一定的复杂性。
PHP Namespaces are largely if not totally irrelevant for the performance of your site. They aid you at writing well-encapsulated and structured code - that's why you should not be afraid to use them, at least if your project reaches a certain complexity.
如果你're 真的担心性能,你应该首先分析,检查你的真正瓶颈在哪里。
If you're really worried about performance, you should profile first and check where your real bottlenecks lie.
这篇关于php命名空间基准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!