最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

debugging - Detecting Javascript Memory Leaks & Optimizing Code - Stack Overflow

programmeradmin2浏览0评论

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.

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?

Is there some kind of steps which I should follow before releasing code for public use?

Thank you very much for your time.

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.

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?

Is there some kind of steps which I should follow before releasing code for public use?

Thank you very much for your time.

Share Improve this question edited Jan 21, 2010 at 21:36 Andreas Bonini 44.9k31 gold badges126 silver badges158 bronze badges asked Jun 5, 2009 at 5:45 Alec SmartAlec Smart 96.1k39 gold badges124 silver badges186 bronze badges 2
  • Duplicate of stackoverflow./questions/95326/… – Matthew Flaschen Commented Jun 5, 2009 at 5:49
  • @Matthew: No. That one is only about IE. – Lightness Races in Orbit Commented Jul 1, 2011 at 14:32
Add a ment  | 

1 Answer 1

Reset to default 3

I think that Fireunit's function call profiling would be the best solution for optimization.

http://ejohn/blog/function-call-profiling/

发布评论

评论列表(0)

  1. 暂无评论