JetBrains-Research / viktor

Efficient f64-only ndarray in Kotlin
MIT License
125 stars 6 forks source link

Test the impact of memory alignment #32

Open dievsky opened 4 years ago

dievsky commented 4 years ago

We could devise a simple enough benchmark to test the impact of alignment on element-by-element operations (e.g addition).

Take a DoubleArray and generate four F64Arrays with different alignments (starting at element 0, 1, 2, 3). Then benchmark adding each of them to another, fixed F64Array. We should see a spike in throughput where alignments coincide.

(This, however, would only be valid if the garbage collector doesn't move the array around between benchmark iterations and shift the alignment.)