IntMap.delete allocates even for absent keys
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- haskell
- Domain
- performance
Research direction
Compare the linked IntMap.delete implementation in containers/src/Data/IntMap/Internal.hs at lines 966-974 with Map.delete in containers/src/Data/Map/Internal.hs at lines 941-955. Start by understanding why the implementations differ and how Word64Map is derived from IntMap. Done means establishing whether pointer checks or a separate deletion variant is warranted, with the chosen scope and expected behavior clearly defined.
Written by the indexing model from the issue text.
Description
I noticed some code in GHC that performs a bunch of deletions (on the very similar Word64Map) with keys that are most likely absent from the map. So now I'm wondering whether to introduce pointer-checks in Word64Map.delete or to split off a delete_possiblyAbsent version or…
But since Word64Map is derived from IntMap, my first question is: why doesn't IntMap.delete perform these pointer-checks already, even though Map.delete does?
- Dominant language
- Haskell
- Stars
- 355
- Forks
- 194
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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.
More from haskell/containers
-
major-release strictness Tree
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
haskell/containers#1260 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
haskell/containers#1261 · 5 comments ·
-
IntSet low-hanging-fruit performance
Difficulty 3/5 1-2 days Newbie friendliness 58/100
haskell/containers#1251 ·
-
maintainability major-release
Difficulty 3/5 1-2 days Newbie friendliness 70/100
haskell/containers#1250 ·
-
performance Tree
Difficulty 3/5 1-2 days Newbie friendliness 55/100
haskell/containers#1247 ·
All issues in haskell/containers
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/phino#1600 ·
Maintainers usually reply within 1 day