a11y.skipToMainContent
1

基准构建器

粘贴两个JavaScript片段,并用可配置的迭代和可选的设置代码作为基准.

Was this tool helpful?
Send output to:
Advertisement

How to use Benchmark Builder

  1. 将JavaScript代码粘入片段 A和片段 B.
  2. 可选择添加共享设置代码并调整迭代.
  3. 点击运行基准比较性能.

{姓名}是什么来着?

一个基准构建器在多个迭代上测量两个JavaScript代码片段的执行时间,以ops/sec度量衡和一个可视比较栏显示相对性能. 开发者使用此来比较算法,数据结构操作,以及库性能.

使用高分辨性能.now () time. 设置字段允许您定义两个片段共享的变量。

Advertisement

FAQ

结果可靠吗?
结果是指示性的,而不是绝对的。 JIT编译,垃圾收集,和浏览器状态会影响时间. 运行多次的信心.
我该把什么放进去?
两个片段都需要的任何代码——可变声明,数据生成等. 它在基准循环之前运行过一次.

Related tools

Author

MW
Marcus Webb"The DevTool Craftsman"

Full-Stack Developer & Tools Architect

Marcus has been writing code since the dial-up era. He has contributed to open-source developer tools, built CI/CD pipelines for startups, and debugged production incidents at 3 AM more times than he would like to admit. His philosophy is that the best developer tool is the one that gets out of your way, and he writes about practical tooling that helps teams ship faster with fewer headaches.

Advertisement