gpt4 book ai didi

ruby-on-rails - Rails,渲染部分时,每个渲染都会在日志中输出。这是性能打击吗?

转载 作者:行者123 更新时间:2023-12-03 00:40:56 25 4
gpt4 key购买 nike

例如,如果循环@feed(呈现部分内容),您会在日志中看到以下内容:

Rendered feeds/_feed_item.html.erb (2.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.6ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (2.8ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (2.5ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.8ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.6ms)
Rendered feeds/_feed_item.html.erb (1.3ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.2ms)
Rendered feeds/_feed_item.html.erb (1.4ms)
Rendered feeds/_feed_item.html.erb (1.5ms)
Rendered feeds/_feed_item.html.erb (1.6ms)

这对性能有影响吗?有没有更好的方法来处理这个问题,这样它就不会每次都输出?

谢谢

最佳答案

是的,这对性能造成了影响。渲染集合。

关于ruby-on-rails - Rails,渲染部分时,每个渲染都会在日志中输出。这是性能打击吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6834360/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com