-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.triagedIssue has been triaged by sub teamIssue has been triaged by sub teamtype-performanceIssue relates to performance or code sizeIssue relates to performance or code size
Description
Hello! I'm experiencing a pretty heavy performance hit with Vector2.clone() on ARM64 (M3) and x86-64 in Dart 3.3.3 on macOS/Windows. This is a continuation of google/vector_math.dart#319, which was misplaced.
Example benchmark:
class Vector2CloneBenchmark extends BenchmarkBase {
const Vector2CloneBenchmark() : super('CloneVector2');
@override
void run() {
for (double i = -500; i <= 500; i += 0.75) {
for (double j = -500; j <= 500; j += 0.75) {
final _ = Vector2(j, i).clone();
}
}
}
}AOT:
CloneVector2(RunTime): 135596.2 us.
For comparison, the same benchmark loop with a custom PointDouble(i, j) + PointDouble(j, i) completes in 9000 us. Only creating and cloning a Vector2 is 15-20x slower than creating two PointDouble and adding them to form a third.
It could be completely unrelated, but the other day I observed another heavy performance hit for the double implementation of i.remainder(j) which seems to occur across different platforms: #55479.
spydon
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.triagedIssue has been triaged by sub teamIssue has been triaged by sub teamtype-performanceIssue relates to performance or code sizeIssue relates to performance or code size