mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 09:43:57 +00:00
c7422d5277
Adds benchmarks using `asTypedList` on Pointers to investigate from where it pays of to do construct a TypedData to do memory access instead of on the Pointer directly. x64 JIT results: - Memory access on TypedData (int8) is ~2,5 faster than on Pointer. FfiMemory.PointerInt8(RunTime): 72.23885718413639 us. FfiMemory.PointerInt8TypedDataReuse(RunTime): 28.239710263614928 us. - Constructing the TypedData for 1000 reads + 1000 writes takes ~20% of the total runtime, 400 reads or writes on TypedData, 160 reads or writes on Pointer. FfiMemory.PointerInt8TypedDataNew(RunTime): 34.345480148372026 us. FfiMemory.PointerInt8TypedDataReuse(RunTime): 28.239710263614928 us. x64 AOT results: FfiMemory.PointerInt8(RunTime): 13.862134213116345 us. FfiMemory.PointerInt8TypedDataNew(RunTime): 26.149628021913365 us. FfiMemory.PointerInt8TypedDataReuse(RunTime): 24.73322780505299 us. - Using asTypedList is slower. (Some optimizations fail to kick in.) Change-Id: I401edb88baf3a3c5094ecae808f122adf258da28 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186289 Reviewed-by: Clement Skau <cskau@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
---|---|---|
.. | ||
FfiMemory.dart |