性能调整淘汰赛应用程序 - 改进响应时间的指南 [英] Performance tuning a knockout application - guidelines for improving response times
问题描述
我有一个大而复杂的页面,它严重依赖于knockout.js.性能开始成为一个问题,但检查调用堆栈并试图找到瓶颈是一个真正的挑战.
I have a large, complex page that relies heavily on knockout.js. Performance is starting to become an issue but examining the call stack and trying to find the bottlenecks is a real challenge.
我在另一个问题中注意到(Knockout.js——理解 foreach 和 with ) 接受的答案有评论:
I noticed in another question ( Knockout.js -- understanding foreach and with ) that the accepted answer has the comment:
...我建议不要在需要高性能的地方使用 with
因为开销...
...and I suggest not using
with
where high performance is necessary because of the overhead...
假设该陈述属实,这确实是值得了解的有用信息,而且我还没有找到此类性能提示的来源.
Assuming the statement is true, this is really useful stuff to know and I have not found a source for such performance tips.
因此,我的问题是:
在深入研究经典性能调优之前,是否有一些通用指南/重要提示可以帮助我提高应用程序的性能.
推荐答案
我认为在一个答案中列出我想到的提示太过分了.
I think that it would be too much to layout the tips that I have in mind in one answer.
我开始撰写有关此主题的一系列博客文章.第一个帖子是这里.
I started a series of blog posts on this topic. The first post is here.
这篇文章描述了 if/with
是如何工作的(复制子元素作为它的模板并在触发绑定时使用模板重新渲染)并解释这些绑定如何导致重新渲染的频率比预期的要高得多.
This post describes a bit how if/with
work (copies the children as its template and re-renders using the template whenever the binding is triggered) and explains how these bindings can be cause re-renders much more often than expected.
我会在以后的帖子中更新这个答案.
I will update this answer with future posts.
这篇关于性能调整淘汰赛应用程序 - 改进响应时间的指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!