Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Severe performance degradation relative to three.js #142

Open
DanielJoyce opened this issue Aug 27, 2014 · 6 comments
Open

Severe performance degradation relative to three.js #142

DanielJoyce opened this issue Aug 27, 2014 · 6 comments

Comments

@DanielJoyce
Copy link
Contributor

The ported demos in three.dart are a lot slower compared to three.js, with much more latency, stuttering, and lower framerate

@DanielJoyce
Copy link
Contributor Author

Ugh, I should qualify this a bit more. Seems some demos are broken, some work perfectly fine. I have noticed that recently, with dual screen on linux, webgl slows down when chrome is full sized on one screen. Shrinking the window slightly fixes it, and for the demos that don't appear to be broken, three.dart is very fast.

@DanielJoyce
Copy link
Contributor Author

I've notices the same behavior with three.js on dual monitor setups with chrome in Linux.

@ghost
Copy link

ghost commented Sep 15, 2014

The problem, at least from what I can tell, is ONLY a problem with JavaScript. I assume you are using the compiled code from Dart to JavaScript on the demos instead of running them through Dart because you said Chrome not Dartium.

For example, after profiling each section of code, the Dart code takes 5x more time for: multiplying matrices, setting matrix3f uniforms, and for setting matrix4f uniforms.

I'll get back to you when I test the code in Dartium, but until then, know that Dart2JS isn't a fair comparison.

@sethladd
Copy link

This might be a good bug for dart2js: if you can create a small repro Dart program that runs very slow when compiled to JS, please add it to a new issue here: dartbug.com/new

@beatgammit
Copy link
Contributor

Here's what I've experienced:

  • slower in Dartium using Dart than Chromium using JS (not generated using dart2js), but only by about ~10 fps (from 55-60 -> 45-50) IIRC
  • about half as fast using dart2js than Dart between Chromium and Dartium

The above is only from memory after playing with it for a few minutes, so I could have my data mixed up.

My program is a 50x50 hex grid with two basic shaders. It's currently ~200 SLOC, but I think I can reduce it a bit. I'll try to post a live demo so both the three.dart team and dart2js team can take a look.

@ghost
Copy link

ghost commented Sep 16, 2014

Do you happen to know what version of chromium dartium is based on? Last time I saw I believe chromium was version 39 and dartium was 37. Do you know if the program is bottlenecked on the CPU or the GPU?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants