Open rakudrama opened 5 years ago
The third benchmark here demonstrates how to modify Matrix4.lerp to run about 25% faster by reusing objects rather than allocating new ones. https://github.com/google/vector_math.dart/commit/4e83308a916339fa2f404945ca4efd994e1c5830#diff-1465efa00171ab51942972af0e358965R92 This works because of Dart's microtask execution model - the reuse all happens during the same microtask.
Matrix4.lerp
You could do better than this by lazy pre-decomposition if the begin and end are stationary, but that would require each Tween to hold the decomposition.
Triage: This doesn't seem like an engine issue. cc @Hixie @goderbauer
The third benchmark here demonstrates how to modify
Matrix4.lerp
to run about 25% faster by reusing objects rather than allocating new ones. https://github.com/google/vector_math.dart/commit/4e83308a916339fa2f404945ca4efd994e1c5830#diff-1465efa00171ab51942972af0e358965R92 This works because of Dart's microtask execution model - the reuse all happens during the same microtask.You could do better than this by lazy pre-decomposition if the begin and end are stationary, but that would require each Tween to hold the decomposition.