Performance 如何评估Dart性能?

Performance 如何评估Dart性能?,performance,web,performance-testing,dart,Performance,Web,Performance Testing,Dart,谷歌正在推出一种新的语言,承诺它有更好的性能,但我如何评估Dart源代码的性能呢 让我们以“”drawFrame方法为例: // Draw the complete figure for the current number of seeds. void drawFrame() { ctx.clearRect(0, 0, MAX_D, MAX_D); for (var i=0; i<seeds; i++) { var theta = i * PI2 /

谷歌正在推出一种新的语言,承诺它有更好的性能,但我如何评估Dart源代码的性能呢

让我们以“”drawFrame方法为例:

  // Draw the complete figure for the current number of seeds.
  void drawFrame() {
    ctx.clearRect(0, 0, MAX_D, MAX_D);
    for (var i=0; i<seeds; i++) {
      var theta = i * PI2 / PHI;
      var r = Math.sqrt(i) * SCALE_FACTOR;
      var x = xc + r * Math.cos(theta);
      var y = yc - r * Math.sin(theta);
      drawSeed(x,y);
    }
  }
//绘制当前种子数的完整数字。
空抽框(){
ctx.clearRect(0,0,MAX\u D,MAX\u D);

对于(var i=0;iGoogle承诺,当浏览器中有本机dart时,以后会有更好的性能

目前,Dart直接编译为JavaScript,比编写纯JavaScript更大、更慢

您现在使用的函数在纯javascript中实际上是相同的,因此编译的dart和直接javascript版本之间的运行时应该非常接近


如果你真的愿意,你可以在jsperf.com上比较编译到JS Dart和JS。

中有性能数据。Dart目前似乎比V8慢2倍左右。但Dart团队认为,这应该会随着时间的推移而改善。

回复晚了,但就在昨天,他们宣布了允许你v8、dart->js和dart虚拟机随时间变化的机架性能

有一篇文章告诉您如何正确地对Dart VM进行基准测试