haskell-lockfree
haskell-lockfree copied to clipboard
Remove one level of indirection for boxed ChaseLev
Previously, we had an IORef (holding an MVector. We can
remove one level of indirection by sticking an Array# directly into an IORef.
That's not officially supported, but it does work (Edward Kmett has used a similar trick).
Before:
ChaseLevDeque -> MutVar# -> MVector -> Array#
Now:
ChaseLevDeque -> MutVar# -> Array#
Note: we previously got the vector size from the MVector; now
we get it from the Array#. In many applications MVectors unbox,
so getting sizes from them is faster than getting them from Array#s.
However, this is not such an application: we're continually storing
and retrieving the vectors. I expect the array size checks will be cost the same
as they did before, but array indexing should be faster.
Note: if this looks like a good idea, we should also do the same for the Unboxed version.
I'm having trouble working out how to update the CI with the necessary primitive version. Any help would be appreciated.
@RyanGlScott , can you maybe help me figure out this CI issue?
@wangbj, Ryan Scott thought you might be able to review this.
@treeowl I’ll try, btw the ci issue should be fixed if you merge master branch