Open treeowl opened 6 years ago
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
Previously, we had an
IORef
(holding anMVector
. We can remove one level of indirection by sticking anArray#
directly into anIORef
. That's not officially supported, but it does work (Edward Kmett has used a similar trick).Before:
Now:
Note: we previously got the vector size from the
MVector
; now we get it from theArray#
. In many applicationsMVector
s unbox, so getting sizes from them is faster than getting them fromArray#
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.