How do you performance test JavaScript code?

前端 未结 22 1093
难免孤独
难免孤独 2020-11-22 04:18

CPU Cycles, Memory Usage, Execution Time, etc.?

Added: Is there a quantitative way of testing performance in JavaScript besides just perception of how fast the code

相关标签:
22条回答
  • 2020-11-22 04:54

    You could use this: http://getfirebug.com/js.html. It has a profiler for JavaScript.

    0 讨论(0)
  • 2020-11-22 04:54

    UX Profiler approaches this problem from user perspective. It groups all the browser events, network activity etc caused by some user action (click) and takes into consideration all the aspects like latency, timeouts etc.

    0 讨论(0)
  • 2020-11-22 04:54

    The golden rule is to NOT under ANY circumstances lock your users browser. After that, I usually look at execution time, followed by memory usage (unless you're doing something crazy, in which case it could be a higher priority).

    0 讨论(0)
  • 2020-11-22 04:55

    I was looking something similar but found this.

    https://jsbench.me/

    It allows a side to side comparison and you can then also share the results.

    0 讨论(0)
提交回复
热议问题