Search Unity

Около года назад мы провели тестирование производительности Unity WebGL для различных браузеров. По этой ссылке доступны полученные нами сравнительные оценки. Прошло достаточно много времени, и мы решили провести повторное испытание, чтобы выявить изменения в производительности.

Одной из основных целей тестирования стала система Windows 10 с новым браузером Edge, поддерживающим по умолчанию подмножество asm.js. Мы также включили в тестирование экспериментальную сборку Unity, обеспечивающую многопоточное исполнение кода с помощью компонента Shared Array Buffers. Чтобы оценить будущий прирост производительности, мы испытывали эту сборку в сочетании с новейшей версией Firefox.

Вы можете попробовать обновленный пакет тестов для оценки производительности по этой ссылке.

Untitled 2

Некоторые изменения методики тестирования по сравнению с прошлым годом:

  • Используется обновленная версия сборки тестов, созданная с помощью Unity 5.3. Вы можете скачать ее здесь и поэкспериментировать сами — локально или на других платформах.
  • Мы убрали из этой версии все графические украшения. Они не несли смысловой нагрузки и лишь увеличивали размер сборки. Благодаря этой чистке стало возможным свободное распространение сборки (см. ссылку выше).
  • Мы пропустили тест «Mandelbrot GPU». Он не подходил для сравнительной оценки производительности различных браузеров, так как загружал только графический процессор, и из-за этого смазывались общие результаты тестирования.
  • Также мы опустили сравнение с автономной нативной сборкой. Мы решили, что результаты такого сравнения недостаточно информативны, так как мы используем различный код для разных платформ с использованием несовпадающих настроек (например, различные реализации обработчика сценариев и наборы шейдеров).
  • Версия EdgeHTML 12 (Edge 20.10240.16384.0), использованная при тестировании, не подключает asm.js по умолчанию. На данный момент доступна версия 13, в которой это исправлено, но для испытаний нам пришлось подключать поддержку asm.js вручную.

Далее приведены результаты сравнительного тестирования различных браузеров. Для тестирования использовался компьютер на основе процессора Intel i7 с частотой 3,3 ГГц, с видеокартой NVidia GTX 960 и ОС Windows 10. Тест экспериментальной версии Unity в сочетании с «ночной» сборкой Firefox выделен серым цветом.:

Screen Shot 2015-11-30 at 1.51.33 PM

Также мы провели несколько тестов на ноутбуке производства Apple (Retina MacBook Pro 15″ с процессором i7 2,6 ГГц и ОС Mac OS X), чтобы получить сравнительные результаты для Safari:

Screen Shot 2015-11-10 at 11.12.52 AM

Далее приведены детализированные результаты каждого теста, проведенного на Windows. За единицу принят результат теста для 32-битной версии Firefox 41:

Screen Shot 2015-11-30 at 1.52.40 PM

Далее — результаты для OS X (результат для Firefox также принят за единицу):

Screen Shot 2015-11-10 at 10.00.57 AM

Приведем для сравнения результат прошлогоднего тестирования. Тогда также использовался ноутбук Retina MacBook Pro 15″ с процессором i7 2,6 ГГц и ОС Mac OS X:

Screen Shot 2015-11-10 at 10.22.29 AM

Наконец, последний график показывает, сколько времени тратится на запуск Unity при использовании различных браузеров. Каждая строка отображает, сколько времени (в секундах) проходит между открытием тестового проекта и завершением рендеринга первого кадра при загрузке с локального диска. Для каждой версии Firefox приведены две строки, представляющие время первого («холодного») запуска с кэшированием результатов сборки asm.js, и последующих («горячих») запусков с пропуском кэширования, которые происходят быстрее:

Screen Shot 2015-11-30 at 1.35.35 PM

Некоторые факты:

  • Наилучших результатов в большинстве тестов из всех публично доступных браузеров достигает 64-битная версия Firefox 42. 32-битная версия заметно уступает в скорости.
  • Edge занимает второе место после Firefox, и в некоторых тестах обходит 32-битную версию. В тестах на производительность рендеринга с использованием библиотеки WebGL Edge превосходит все остальные браузеры.
  • Safari сравним по производительности с Chrome. Прошлогодние тесты показывали значительное превосходство Chrome.
  • Internet Explorer 11 твердо занимает последнее место.
  • Экспериментальная версия Unity с использованием Shared Array Buffers значительно увеличивает производительность, иногда — в несколько раз. Это дает некоторые представления о том, на какие показатели производительности следует ориентироваться в будущем.
  • Производительность Firefox на OS X выросла в среднем на 18% по сравнению с прошлогодними результатами. Отчасти это происходит благодаря оптимизации версии Firefox 41 по сравнению с 32, но главным образом ускорение обязано улучшениям в Unity и в компиляторе emscripten. Производительность на Windows выросла заметнее, так как 64-битные версии Firefox для этой ОС появились недавно, а для OS X существовали уже долгое время и уже использовались в прошлогоднем тестировании.
  • Большинство браузеров загружает тестовый проект за 5–7 с. Firefox способен сократить это время до 1,5–2 с при выполнении горячей загрузки с заранее кэшированной сборкой asm.js.

Комментарии закрыты.

  1. I’m missing Pale Moon in the benchmarks….

  2. Is there a reason safari was left out of the loading/reloading time benchmark?

  3. I can’t run the benchmark in Internet Explorer 11 ( Inori version ), the WebGL player return an Out of memory error.

    On Linux, without proprietary drivers and running Firefox, the benchmark «runs», I mean, the whole screen is messed up, but at least it runs. With proprietary drivers on, I got a wonderfull pinkish bubblegum screen, and nothing works.

    1. Sorry about double post, but the WebGL bench just started in Internet Explorer 11 (Inori version), it seems that the Out of Memory is pretty random…

      My scores:

      Mandelbrot Script: 15 169
      Instantiate & Destroy : 10 806
      CryptoHast Script: 46 588
      Animation & Skinning: 34
      Asteroid Field: 2 148
      Particles: 13 010
      Physics Meshes: 29
      Physics Cubes: 38
      Physics Spheres: 51
      2D Physics Spheres: 103
      2D Physics Boxes: 72
      AI Agents: 250

      Overall Score: 11 476

  4. In window 10 in Firefox 42 64-bit I get this error message during the skinned mesh animation:
    https://dl.dropboxusercontent.com/u/55553379/Unity%20webgl/Firefox%2042%2064-bit.PNG

    It runs fine on Firefox 42 32-bit and on Edge 12.

    Does anybody else have this problem?

    I have 24 gigs of ram, GTX770 with 4gb DDR5

  5. Glad to see some benchmarks around this. I was especially surprised to see how the different browsers performed on my own hardware. I definitely get different results on Windows 10. I actually get Edge>Firefox>Chrome. Not entirely sure why though.

    As far as performance, its getting to «good enough» for many things. I won’t be trying to push AAA content directly in the browser, but for things like social games and apps — its definitely pretty close to where I don’t care so much about the benchmarks anymore.

  6. Is there an available demo built using the shared array buffers? I have a 24-core workstation I’d like to test scalability on.

  7. How about mobile browser?

    i tried a small project with just a ugui scroll view, only have 15 fps in release WebGL in iphone 6s safari.

    Looking forward to see better performance in mobile browser :D

  8. What about Firefox and Chrome on Linux? Without it, these results are pretty incomplete.

    1. The biggest point of these benchmarks is to see differences in performance of the browser’s JavaScript engines. These should be fairly consistent between different OSes. The only reason we tested both OS X and Windows in this benchmark was that we wanted to show how Safari compares to the other browsers. Some of the differences in results may also come from differences in WebGL implementations — OS X and Linux should be similar there, as both are based on OpenGL, and underlying GPU drivers (but showing the differences between GPU drivers is not the point of this benchmark).

    2. Here’s Chromium 47 on Arch Linux with an i5-4460 and a GTX 970.

      http://i.imgur.com/RBlpk7o.png

  9. My results on Firefox 43 64 bits, Windows 8.1 64bits, NVIDIA GTX 780 (358.87):

    With Angle (D3D11?) : 67794

    With «webgl.disable-angle» : 68138

    Seeing your results, either something went wrong in 43 or I’ve done something wrong in my Fox config.

  10. Firefox 44.0a2 / Linux
    Results are meh: http://i.imgur.com/wyPFjSl.png

    1. http://i.imgur.com/bqpiPK9.png

      This is on Arch with NVIDIA’s (proprietary) drivers and default settings aside from the Arc theme. I get similar results on Openbox.

    2. I heard that 2016 will be the year of Linux on the desktop. Honestly, any decade now.

    3. Fedora Linux 23
      AMD A8-6600K APU
      Firefox 42
      54965 overall

      The results published in the blog are basically useless, because of being normalized. Since they don’t give the numbers in a way that I can use to compare my own results to the published results, it is all meaningless. Even after you run it yourself, you get no comparative information, and the types of things tested are very different from each other. Presumably there is some sort of typical reason common to published benchmarks why this would be concealed. ;)

      1. The reason is not about concealing anything, but simply about making all the benchmarks fit in a single chart, as the numbers for each of them are vastly different. The purpose of this blog post is to show relative differences between different browsers on the same hardware, to show how different JavaScript VMs and WebGL implementations compete. For this purpose, absolute numbers are not needed.

    4. Debian Sid with Iceweasel running on a 4K monitor. Not bad.

      http://i.imgur.com/zNJdNzV.png

  11. OSX 10.11
    Firefox 43.0

    iMac 24GB Ram, 4GB 780m.

    During the Particles benchmark, firefox throws up a dialog «Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.»

  12. I would also have liked to see results from linux in comparison. I guess we would still see some funny results heading in unknown direction, but knowing is always better than guessing :)

  13. Sad that Firefox 43 and 46 was not tested.
    Also It could be a very useful idea to bench also on Linux. The gpu drivers are really different.

    And what about the layout engine of the future ? Servo + webrender +browser.html

  14. I took a look at webgl export in 5.3 .. safe to say i won’t be bothering with it, the output scene lighting was completely off from the web standalone, and performance of the scene even after changing settings to be as low as possible was just not worth it.

    And the webgl compile time turned my pc into barely useable brick for way too long, no idea who’s bright idea it was to set all compiling processes thread priority onto anything but ‘below normal’ kinda stupid given there is no setting in unity to set the thread priority before it starts, probably the same programmer who set the lighting building processes to the same.

    oh and to top it off the webgl version left a 70mb opengl.js with the total size for webgl export being 82mb. Unity provides no way of seeing what the hell its exported out. For comparison the web standalone export was 3mb.

    Maybe in 2017 webgl might be worth checking out again right now its bleh, ofc UE current track of releasing decent updates with actual built in engine features as opposed go find and buy such improvements at the asset store might have me switching to that in 2016 instead.

  15. Firefox 43 64 bit / Windows 10 64 / i3 530@4 GHz+8GB RAM / GeForce 750 Ti

    My results:

    Native WegGL+WebGL2 — 64590
    Native WegGL — 61865
    Angle D3D11 — 54857
    Angle — 50575

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

  17. 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,

    1. Failfox is such an awesome pile of burpware.

  18. 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. «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.

      1. What exactly are those controlled contexts and certain times if I may ask? Does not referencing GC objects mean we can only use local value types in threads? For example, what would not work in a multithreaded WebGL environment that would work in a multithreaded standalone?

        1. Basically, with the current setup, it is not possible to have any reference to a managed object (ie a GC handle) on any stack when GC takes place (which is currently once at the end of any frame). So managed threads which run longer then the duration of a frame would not be possible (since this would probably rule out most use cases people are interested in, we would not enable managed threads at all, before we can solve this problem somehow).

  19. 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. 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.

      1. Thanks for the reply and the added information.

        I agree there is room to interpret exactly where the performance differences come from. However, it’s not as though you can choose to build for «WebGL using the standalone code paths». Regardless of the sources of the differences, the fact is they are the inherent cost of choosing to target WebGL. As such, the absolute differences are the more salient information, rather than the precise reason they exist.

        I’m happy to see WebGL coming along. Thanks for the blog post.

  20. 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.

  21. 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. 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).