doumaikuang4202 2017-04-06 14:41
浏览 51

Twig包括有和没有传递变量的性能

I am wondering what is best perfomance-wise, using

{% include "_inc/template" %}

or

{% include "_inc/template" with {'foo': bar %}

assuming foo is the only variable used in _inc/template and it's also available in global context.

Will there be significant difference in performance between two approaches, if the include is placed within for having ~50 loops?

  • 写回答

1条回答 默认 最新

  • doujia7517 2017-04-06 15:08
    关注

    I don't have direct answer to your question, but you can use the profiler in dev toolbar to see the timeline of the calls.

    Maybe try and tell us...

    Which is the version of symfony you use? I know that in symfony > 2.7 the timeline Graph exist.

    Ps : Maybe try it with this too:

    {% include 'template.html' with {'foo': 'bar'} only %}
    
    评论

报告相同问题?

悬赏问题

  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退