5 ms·
As far as I know this is an RRB vector. Here's the original paper: https://infoscience.epfl.ch/record/213452/files/rrbvector.pdf https://infoscience.epfl.ch/re
by AlexanderDhoore 7y ago
As far as I know this is an RRB vector.
Here's the original paper: https://infoscience.epfl.ch/record/213452/files/rrbvector.pdf https://infoscience.epfl.ch/record/213452/files/rrbvector.pd...
A rust implementation: https://docs.rs/im/13.0.0/im/ https://docs.rs/im/13.0.0/im/
C++ implementation: https://github.com/arximboldi/immer https://github.com/arximboldi/immer
The rust implemenation does a cool trick where the data is only copied when it is shared. If you are the sole owner of the data structure it will simply mutate it in place. So you don't lose any performance. But once you share it, it becomes an immutable functional data structure. See https://docs.rs/im/13.0.0/im/#in-place-mutation https://docs.rs/im/13.0.0/im/#in-place-mutation