19 comments

[ 2.6 ms ] story [ 42.7 ms ] thread
Indeed great work! Is Google's guava collections part of this research?
Guava’s “immutable” collections are effectively read-only indices, and do not support efficient updates.
(comment deleted)
Pet peeve: I wish people would call them persistent or fork-on-write, but functional at least is better than immutable.
Why? Fork-on-write seems very descriptive and nice, persistent seems less illuminating than immutable. Functional... eh, as someone who already knows the functional programming paradigm, I know what it means, but it would otherwise be an unhelpful descriptor.
(comment deleted)
Would "purely functional data structures" float your boat?

I suspect the idea is to tie in with the idea of '(purely) functional programming', which is where these will shine.

In any case the term '(purely) functional data structures' seems pretty well entrenched and dates at least to Okasaki's thesis in the late 1990s, possibly earlier (I'm not an expert). In fact, it looks like the link actually mentions Okasaki's work.

So an appeal to authority? [0] Or to tradition, I'm not sure.

[0] https://www.logicallyfallacious.com/tools/lp/Bo/LogicalFalla...

No, not really. I'm not saying anything about what these things ought to have been called in a perfect world (though I think it actually fits pretty well). I'm observing that they've been called by this name for a while, so even if you can find an unambiguously better one, popularizing it may be hard.
I always thought it came from the well-known 'Purely Functional Data Structures' by Chris Okasaki.
Note that Scala 2.13 (next release) includes a CHAMP hash map implementation, first contributed by the original author and then refined by several Scala contributors, most notably Jason Zaugg (@retronym) and Josh (@joshlemer)
I tried to include these, but it wasn’t immediately obvious how to construct them from outside Scala without CanBuildFrom. If anyone wants to open a PR or even provide a few hints, I’d be happy to update the benchmarks.
I see you have written interfaces like List & Maps. Probably, we need to use interfaces from Java native, but provide better implementation through bifurcan. This makes it easy for existing applications to switch to bifurcan where they need.
Thanks for sharing! One quick question: in the methodology section, you mention that the results are from a median value out of repeated runs. While I get that you run JITted code, you also mention that it makes the runs isolated from GC side-effects.

Just out of curiosity, what did you do to ensure that GC would not interfere with the execution while the tests are running?