Add prefetch{Small}{Mutable}Array[0..3]#
We now have a number of prefetch operations:
prefetchAddr0# prefetchMutableByteArray0#
prefetchAddr1# prefetchMutableByteArray1#
prefetchAddr2# prefetchMutableByteArray2#
prefetchAddr3# prefetchMutableByteArray3#
prefetchByteArray0# prefetchValue0#
prefetchByteArray1# prefetchValue1#
prefetchByteArray2# prefetchValue2#
prefetchByteArray3# prefetchValue3#
but we are missing variants for fetching slots of a {Small}{Mutable}Array#
.
This differs from fetching the item pointed to by the entry at that address, so prefetchValueX
does us no good there. Basically this just needs to compute the offset of the appropriate slot and prefetch the memory for that portion of the array as an address like we do indexing into a byte array.
I have some code that could benefit a fair bit from being able to prefetch a binary search on array elements this way, when storing those elements either in a traditional sorted order or Eytzinger layout.
I've verified this experimentally by unsafeCoercing existing bytearray primitives to make them work on other array types.
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.2 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Runtime System |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | ekmett |
Operating system | |
Architecture |