WebGLベンチマーク結果のアップデート

12月 15, 2015 : Technology

一年ちょっと前、私たちはUnityのWebGLに関する異なるブラウザー間でのパフォーマンスベンチマークのブログ記事をアップしました。そろそろこのベンチマークも立ち戻って更新する時期だと思いましたので、どのように数値が変わったのか調べてみました。

Microsoftはその後、Windows 10で新しいEdgeブラウザーをリリースしました。このブラウザーはasm.jsをサポートし、かつその機能はデフォルトで有効になっています – だので、どのくらい良い結果が出るのか大変興味がありました。その他、私たちはShared Array Buffersが有効になってマルチスレッドでコードが実行出来るようになったUnityの実験ビルドも作ったので、それでどのくらいのパフォーマンスの改善が見込めるのかもチェックしたいと思いました。このバージョンのUnityはShared Array Bufferサポートが有効になったFirefoxのナイトリービルドを使ってテストすることにしました。

もしお使いのブラウザーで今回のベンチマークを実行したい場合は、ぜひブラウザでこちらをアクセスして試してみて下さい。

Untitled 2

去年のベンチマークからの手順の変更点に関するノート:

  • このベンチマークは今回アップデートしたベンチマーク・スイートをUnity 5.3でビルドしたものを使用しています。ベンチマーク・スイートのプロジェクトフォルダーはこちらからダウンロード出来ますので、お使いのローカル環境や別のプラットフォームでもご自由にお試しいただけます。
  • このバージョンは前回存在していた全てのアートワークやアイキャンディーを除去しています。それらはベンチマークに一切の価値を付与しませんし、プログラマーによるアートはどちらにしろショボいのでやめにしました。アセットを除去することでビルドも小さくなりましたし、より重要な点はプロジェクトフォルダーを再配布することが可能になったということです。(上記のリンクを参照下さい)
  • “Mandelbrot GPU”(マンデルブロGPU)はブラウザ間の差異をあまり示さず、基本的に単なるGPUのベンチマークでしかなかったので、テストスイートから除外することにしました。副作用としては、これによりブラウザーの全体スコアの相対的な差の値が前回よりもより小さくなるという影響が出ています。
  • 去年までは入れていたネイティブスタンドアローンビルドとの比較も誤解を招きやすいので除去することにしました。私たちはプラットフォームが異なるときに実際には全く違うコードを実行するので(たとえば異なるクオリティ設定で全く違うシェーダー実装を使用したり、そもそもスクリプトエンジン自体が違ったりもします)これはミスリーディングな比較だと判断しました。
  • 私たちは以前ベンチマークを実行するときには、最新であった EdgeHTML 12 (Edge 20.10240.16384.0) を使用しましたが、デフォルトではasm.jsのサポートは有効ではなかったので、これを手動で有効にして利用しました。今現在ではEdgeHTML 13がリリースされており、デフォルトでasm.jsのサポートがデフォルトで有効になっています。

こちらがベンチマーク・スイートによるそれぞれのブラウザーでの総合スコアです。ベンチマークは 3.3.GHzの Core i7 CPU と Nvidia GTX 960 GPU を載せたWindows 10 PCでの実行結果です。Shared Array Buffers サポートの入ったFirefox 45はナイトリービルドのFirefoxと実験ビルドのUnityを使っているので、グレーのバーで表現しています:

Screen Shot 2015-11-30 at 1.51.33 PM

こちらがMac OS Xでの異なるブラウザー間のスコアです。2.6 GHz のCore i7 CPUを載せたRetina MacBook Pro 15”での実行結果になります(他のブラウザーとSafariの比較用にどうぞ):

Screen Shot 2015-11-10 at 11.12.52 AM

こちらがWindowsでの個々のベンチマークの違いです。個々のテストについて、32bit版のFirefox 41を1.0としてスケールしています:

Screen Shot 2015-11-30 at 1.52.40 PM

こちらがOS Xについての個々のベンチマークです。こちらも個々のテストのFirefoxを1.0としています:

Screen Shot 2015-11-10 at 10.00.57 AM

こちらが去年のベンチマークに対する今年のベンチマーク結果の全体的な比較です。去年からパフォーマンスがどのように変わったかが分かります。これは 2.6 GHz Core i7 CPUのRetina MacBook Pro 15”を使ったMac OS Xでのスコアの比較です:

Screen Shot 2015-11-10 at 10.22.29 AM

最後に、こちらがUnityのコンテンツが起動するまでの時間に対するベンチマークになります。下のバーは個々のブラウザーでベンチマークプロジェクトを開いてから最初のフレームがレンダリングされるまでの秒数です。このとき、コンテンツはローカルディスクから読み込まれているので、ネットワークからのダウンロード時間は無視されています。Firefoxはasm.jsのコンパイル結果をキャッシュするので、同じコンテンツが2回目にロードされる時にはコンパイルがスキップ出来、結果ロードが高速になります。ベンチマークではFirefoxはこの2つのケース(最初のロード(cold)と2回目のasm.jsのコンパイルキャッシュが聞いた時のロード(hot))を載せています:

Screen Shot 2015-11-30 at 1.35.35 PM

わかったこと:

  • 64bit版のFirefox 42が現在出荷されているブラウザーの中でベンチマークでは最速をマークしました。32bit版のFirefoxは64bit版に比べて目に見えて遅いことも分かりました。
  • 新しい挑戦者として登場したEdgeはベンチマークでは2位にマークし、ほとんどのベンチマークにおいてFirefoxに近い結果を叩き出しました。(しかも、32bit版のFirefoxよりも高速でした)WebGLのレンダリング負荷を試すベンチマーク各種(ParticlesやAsteroid Field)では、Edgeは全てのテストしたブラウザーの中で最高のパフォーマンスを記録しました。
  • Safariは1年前はChromeに比べて大幅に遅い結果を出していましたが、今回はChromeに匹敵するパフォーマンスを発揮しました。
  • Internet Explorer 11 は概ねすべてのベンチマークで他のブラウザーより大幅に遅く、基本的にはUnityのWebGLコンテンツを再生するには遅すぎるブラウザーと言えます。
  • Shared Array Buffersを有効にしたUnityのビルドはパフォーマンスを大幅に(ベンチマークによっては数倍)改善することが分かりました。これは将来期待できるパフォーマンスの改善がどの程度かということの見通しとして有効な情報だと言えます。
  • 全体的に、Firefoxでは、1年前と比べて大体18%パフォーマンスの改善が見られました。これはFirefox 41がFirefox 32に比べてより高速に動作するようになったことも一因だと考えられますが、より大きくはUnity自体の改善とemscriptenコンパイラーの改善による結果と考えられます。この結果は64bit版のFirefoxが長く存在するOS Xに関するものです。Windowsではそもそも64bit版のFirefox自体がようやくリリースされたことにより、改善の幅はより大きなものとなるでしょう。
  • ロード時間を見てみると、ほとんどのモダンなブラウザーはベンチマークプロジェクトを大体5〜7秒でロード出来ています。Firefoxはasm.jsのコンパイル結果をキャッシュ出来るので、2回目のロードを1.5〜2秒まで圧縮できています。

コメント (9)

コメントの配信登録
  1. Caspy7

    12月 16, 2015 12:24 am /  返信

    Bit funny this was released the day that Firefox 43 came out. :)

  2. Jaroslav Stehlik

    12月 15, 2015 11:03 pm /  返信

    Firefox 43.0 Out of memory during particle system.
    OS X EL Capitan
    Mac Book Pro Retina
    mid 2014, 2,5 Ghz, 16 GB RAM,

  3. Arowx

    12月 15, 2015 8:33 pm /  返信

    Great work.

    Will Shared Array Buffers be mapped to C# threads so our own multi-threaded code can take advantage of them via IL2CPP?

    Any news on progress with SIMD, WebGL 2.0, WebVR and WebAssemby.

    1. Jonas Echterhoff

      12月 15, 2015 9:38 pm /  返信

      “Will Shared Array Buffers be mapped to C# threads so our own multi-threaded code can take advantage of them via IL2CPP?”

      Initially, no. Arbitrary C# threads are harder to allow because we cannot walk the stacks in JavaScript to perform garbage collection, so we can only allow threads in a controlled context where we know when we can safely assume no GC objects are referenced on any thread’s stack at certain times.

  4. Adam

    12月 15, 2015 8:11 pm /  返信

    I disagree with the decision to omit standalone results from the comparison.

    It’s important to understand the performance hit you’re going to take by choosing WebGL over standalone. Which areas are significantly weaker? Which are nearly comparable?

    Further, performance is increasing over time on standalone as well and it’s valuable to compare the changes on each platform. If performance increases on standalone are outpacing those of WebGL, that means the gap between the platforms is increasing even in the face of the WebGL improvements and will affect the decision to leverage the platform. Likewise, if the gap is closing, that makes a stronger case for WebGL.

    I have to wonder if the comparison was omitted because it potentially paints WebGL in a more negative light, but imho the comparison is crucial to making an informed decision. Sure, we can do the benchmarks ourselves, but why omit the information when you’re already publishing results publicly?

    1. Jonas Echterhoff

      12月 15, 2015 10:08 pm /  返信

      Well the point is that you can interpret different things into comparing numbers from different platforms as they may run things very differently, with different outputs.

      But, fair enough – here are the numbers from my MacBook Pro:

      Native:
      Mandelbrot Script: 30754
      Instantiate & Destroy: 69579
      CryptoHash Script: 122416
      Animation & Skinning: 1156
      Asteroid Field: 10077
      Particles: 127690
      Physics Meshes: 1677
      Physics Cubes: 2649
      Physics Spheres: 3237
      2D Physics Spheres: 3359
      2D Physics Boxes: 2170
      AI Agents: 6471
      Overall: 143219

      Firefox:
      Mandelbrot Script: 133846
      Instantiate & Destroy: 61892
      CryptoHash Script: 212708
      Animation & Skinning: 495
      Asteroid Field: 8566
      Particles: 102580
      Physics Meshes: 600
      Physics Cubes: 820
      Physics Spheres: 1658
      2D Physics Spheres: 2466
      2D Physics Boxes: 1488
      AI Agents: 1950
      Overall: 84443

      Noticeable points:
      -Scripting benchmarks are actually faster in WebGL then in native. This is due to different scripting backends used (il2cpp vs mono)
      -Benchmarks which are mostly rendering bound (Asteroid Field, Particles) perform very close to native.
      -Benchmarks which benefit from multithreading a lot (physics, skinning) are significantly faster in native code.

      Overall not much has changed in these findings since last year. No surprises there, as the constraints have not really moved (other then some browsers like Edge catching up on performance). This will change when technologies like Shared Array Buffers will be available.

  5. DaveVoyles

    12月 15, 2015 6:10 pm /  返信

    Awesome, I was in the middle of writing a presentation on Unity’s WebGL benchmarks when you updated this today.

    Thanks for keeping us in the loop, looking forward to seeing how browsers improve perf over time.

  6. Mal

    12月 15, 2015 5:54 pm /  返信

    Great to see more info on WebGL builds.

    What about mobile ( other WebGL tech seem to work ok, eg Blend4Web, PlayCanvas etc ), would be cool to have WebGL as a potential option for smaller games across desktop and mobile.

    Also would be cool to have report on reduced file size ( if any ), of say a single cube, to get an idea of the overhead pre adding assets. Maybe build times as well.

    Keep up the great work in this area!
    Mal

    1. Jonas Echterhoff

      12月 15, 2015 9:36 pm /  返信

      Unity WebGL runs on mobile, but currently the results are only usable on very high-end devices (depending on your content), so we cannot recommend it. The other engines you named are not really comparable to Unity in terms of functionality, and have a much smaller foot print in code size, which makes them a better fit for today’s mobiles. I expect technology to catch up with this in the future, both in the form of faster mobile devices with more memory, and better performance from browsers and technologies such as WebAssembly.

      Unity 5.4 should give you an option for much faster development builds. We are also working on a Build Report feature which will get you detailed information on build size and where the size comes from (currently planned for 5.5).

返信する

あなたのメールアドレスは公表されません。

これらの HTML タグや属性を使用できます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>