Drop id wrapper - #1479
Open
jonludlam wants to merge 5 commits into
Open
Conversation
These were introduced in 2c2ff6c to replace polymorphic compare and hash. Recent measurements show that these don't have a useful effect any more, and they cost a lot when storing the odoc files on disk as there's no sharing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
No need to keep the record now that ikey/hash are gone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jonludlam
force-pushed
the
drop-id-wrapper
branch
from
August 27, 2026 16:29
c9a95fa to
55a5e84
Compare
Structurally equal paths used to be shared, via a memo in Lang_of that d1c0bad stopped applying and d90903a then removed. Repeated paths have been written out in full since. Hash-cons the converted paths instead, which doesn't need the maps and so shares across a whole run. Path.Resolved.Module gets the equal/hash/Hashtbl that Identifier already has, with the same hashing parameters. aliaschain.t goes from 1.1MB to 33KB, and peak RSS while linking from 70MB to 43MB; a full `odoc_driver core` run is ~14% smaller. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This simplification is the removal of an optimisation that's measurably unnecessary now. The end result is something that runs just as fast as before, but with a large decrease in memory and disk usage. The reduction in disk space is around 30% overall. The memory usage decreases by a lot less - around 5%.