Similar to xdebug+webgrind which gives us the rough time for execution for each function in a file etc, I am wondering how to go about optimizing as well as detecting slow javascript functions.
类似于xdebug + webgrind,它为我们提供了执行文件中每个函数的大致时间等,我想知道如何优化以及检测慢速javascript函数。
Am sure firebug can probably do this, but am not sure how? Can someone guide me as to how to detect memory leaks also? How do I decide if a function is too slow? I mean is there any benchmark, for e.g. in PHP i have a rough idea that any script which requires more than 200ms execution time, is kinda slow/maybe can be refactored. Roughly how many seconds should my code execute so that my browser experience is not sluggish? I know its a vague question... but are there any benchmarks?
萤火虫可能会这样做,但我不确定如何?有人可以指导我如何检测内存泄漏吗?如何判断函数是否太慢?我的意思是有任何基准,例如在PHP中我有一个粗略的想法,任何需要超过200毫秒执行时间的脚本,有点慢/也许可以重构。我的代码应该执行多少秒才能使我的浏览器体验不缓慢?我知道这是一个模糊的问题......但有没有基准?
Is there some kind of steps which I should follow before releasing code for public use?
在发布代码供公众使用之前,我应该遵循哪些步骤?
Thank you very much for your time.
非常感谢您的宝贵时间。
1 个解决方案
#1
I think that Fireunit's function call profiling would be the best solution for optimization.
我认为Fireunit的函数调用分析将是优化的最佳解决方案。
#1
I think that Fireunit's function call profiling would be the best solution for optimization.
我认为Fireunit的函数调用分析将是优化的最佳解决方案。