JuliaCollections / JuliaCollections/DataStructures.jl
Docs for SwissDict in wrong order, and questions about it
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 745
- Forks
- 261
- PR merge metrics
- No merged PRs in 30d
Description
Hi @eulerkochy,
https://github.com/JuliaLang/julia/pull/38167/commits/3f5f9dbf65ed9ec27fe885a675261d5e7873832f
[I can fix that here too.]
When I realized SwissDict is actually ordered, I decided to use it! It seems like an awesome design, I watched the Google video.
Then when I saw the doc issue, it got me thinking, is it for sure an ordered container (not by accident, or is until it isn't for some reason...)? The docs here doesn't say, and for the C++ implementation, I've not tracked it down. I assume you just copy pasted some doc from Dict maybe and didn't change the order. And the C++ is also ordered, not something you added to the design, i.e. I assume you're trying to closely follow it?
I'm copying your implementation to Base, then I saw:
https://github.com/JuliaCollections/DataStructures.jl/pull/634
As of now, the benchmarks aren't favorable.
The little benchmarking I did, using your code, it seemed fast/er, so is that an outdated statement? And should the code at least work? What's your confidence level? At first I was getting OrderedDict into Base, as it's been used for a long time, but I actually found a bug (for recursive Dict, that seem ok for your SwissDict).
Mostly I do not care about the speed, unless it's awful, rather the ordered guarantee (and bug free...).
I did see for your other dict:
https://nextjournal.com/eulerkochy/ordered-dictionary-an-alternative-approach
To guarantee the maintenance of order, we have to compromise on time complexity of deletion.
Is that a statement only about that implementation? If I recall you can keep the same time-complexity for all operations going ordered. Maybe I misremember, or maybe there's a trade-off, and you do intentionally go for worse time-complexity for some less important/rarely used operations, to get performance on the more important ones? Do you know for SwissDict?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the SwissDict documentation and the linked JuliaLang pull-request commit. Compare its ordering claims and implementation with the questions raised about DataStructures.jl pull request 634 and the linked ordered-dictionary article. Done would require a defined documentation change and resolved answers about ordering, performance, and complexity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100