dmah42 / dart-box2d

Box2D for Dart
http://dart-lang.github.io/dart-box2d/
34 stars 5 forks source link

PolygonShape dynamic length lists #3

Closed dmah42 closed 10 years ago

dmah42 commented 11 years ago

PolygonShape currently uses fixed-length Lists for verticies and normals (length 8 from Settings) which seems inefficient.

We should investigate whether performance gains (CPU/GC) from using dynamic-length lists.

dmah42 commented 11 years ago

http://stackoverflow.com/questions/15943890/is-there-a-performace-benefit-in-using-fixed-length-lists-in-dart

It seems that the difference isn't that big when using dart2js compiler but with native Dart VM fixed-length Lists are much better choice. I haven't tested it on any benchmark so I can't say how big is the difference.