Skip to content

Drop id wrapper - #1479

Open
jonludlam wants to merge 5 commits into
ocaml:masterfrom
jonludlam:drop-id-wrapper
Open

Drop id wrapper#1479
jonludlam wants to merge 5 commits into
ocaml:masterfrom
jonludlam:drop-id-wrapper

Conversation

@jonludlam

Copy link
Copy Markdown
Member

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%.

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 and others added 3 commits August 28, 2026 00:04
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant