Conversation
This also fixes a problem with verifying lookups that caused this test to blow the stack.
The idea here is to ensure maximal sharing, so paths that contain a lot of repetitive paths remain small in absolute memory usage
Julow
left a comment
There was a problem hiding this comment.
Could it be a global memo ? There's a lot of empty () so potentially a lot of memos that aren't shared.
| let cp = Component.Of_Lang.(type_path (empty ()) p) in | ||
| match Tools.resolve_type_path env cp with | ||
| | Ok p' -> `Resolved (Cpath.resolved_type_path_of_cpath p') | ||
| | Ok p' -> `Resolved Lang_of.(Path.resolved_type (empty ()) p') |
There was a problem hiding this comment.
We had two ways to convert from Cpath.* to Path.* - I deleted the ones in Cpath and added the memoisation to the other (in Lang_of).
|
I considered a global memo, but it's all quite contextual - so converting from the same |
|
In case it wasn't very obvious from the diff, this can make a startling difference (in the pathological case the test case is testing) - the size of the |
CHANGES: Additions - New subcommand to resolve references (@panglesd, @lubega-simon, ocaml/odoc#812) - Improved rendering of long signatures (@panglesd, ocaml/odoc#782) - Handle comments attached to open statement as floating comment, instead of dropping them (@panglesd, ocaml/odoc#797) - Empty includes (containing entirely shadowed entries) are now hidden (@panglesd, ocaml/odoc#798) Bugs fixed - Fix a missing Result constructor during compile. This will cause some functor arguments to have different filenames (@jonludlam, ocaml/odoc#795) - Better memory/disk space usage when handling module alias chains (@jonludlam, ocaml/odoc#799) - Resolving class-type paths (ie., `val x : #c`) (@jonludlam, ocaml/odoc#809) - Skip top-level attributes while extracting the top comment. Fix top-comment extraction with PPX preprocessing (@jorisgio, ocaml/odoc#819) - Better handling of @canonical tags (@jonludlam, ocaml/odoc#820) - css: improved layout (@jonludlam, @Julow, ocaml/odoc#822)
The aim here is to reduce the amount of memory used when compiling long chains of aliases, which currently causes problems.