Performance issue when running on local machine

38 views
Skip to first unread message

First Last

unread,
Nov 10, 2018, 5:03:32 AM11/10/18
to StageXL
Hello, I found some strange performance issues when running on local machine.
If I run this benchmark http://www.stagexl.org/example/benchmark/bunny_mark/ I get about 5% CPU usage of Google Chrome in 10000 sprites. If I run this benchmark on local machine I get about 20-30% CPU usage in 10000 sprites and high fps drop. Sorry for my bad english.

Nils Döhring

unread,
Nov 12, 2018, 10:43:03 AM11/12/18
to StageXL
Hey, this might have to do with how you're running your local example. Dart has two JS compilers: dartdevc for use during development, dart2js for use during production. dartdevc actually creates readable code which also allows for debugging and profiling – the JS files it generates are gargantuan in amounts and sizes thought, and this could be the cause of the difference in performance you're noticing. 

See the webdev package for more info: https://webdev.dartlang.org/tools/webdev
(this is the same package used by the Dart plugin for IntelliJ)

Please let us know if this is the issue.

Filipe Morgado

unread,
Nov 12, 2018, 12:10:32 PM11/12/18
to StageXL
Also, make sure to enabled the two following dart2js command-line arguments:
  • --trust-primitives
  • --trust-type-annotations
Depending on the use-case, those arguments may provide a very significant performance boost (and smaller code).


First Last

unread,
Nov 12, 2018, 2:12:03 PM11/12/18
to StageXL
Thank you for answers! Running in --release mode solved the problem.
Reply all
Reply to author
Forward
0 new messages