Skip to content

fix(findlib): memoize findlib db properly - #16412

Merged
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-utvssxrmykky
Sep 21, 2026
Merged

Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-utvssxrmykky

Conversation

@Alizter

@Alizter Alizter commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

The table was being recreated for each call of create_with_paths making the memoization useless. We move the Per_context wrapper to create, where it can actually be keyed against the context name.

The caller of create_with_paths is pretty dubious, but I don't want to touch the dev tools support at the moment, so I've left it alone.

@Alizter
Alizter requested a review from rgrinberg September 14, 2026 17:20
@Alizter
Alizter marked this pull request as ready for review September 14, 2026 17:20
@Alizter
Alizter force-pushed the push-utvssxrmykky branch 2 times, most recently from 8327625 to 8f0c15d Compare September 15, 2026 09:33
@rgrinberg

Copy link
Copy Markdown
Member

Is the bench old? why is it showing that this is slower?

The table was being recreated for each call of create_with_paths making
the memoization useless. We move the Per_context wrapper to create,
where it can actually be keyed against the context name.

The caller of create_with_paths is pretty dubious, but I don't want to
touch the dev tools support at the moment, so I've left it alone.

Signed-off-by: Ali Caglayan <[email protected]>
@Alizter

Alizter commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I only see a very small slowdown that could be explained as noise. The minor word count appears to have shifted correctly however.

@rgrinberg rgrinberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see nothing wrong in this PR. I still find it puzzling that there's no observed improvement observed anywhere.

@Alizter
Alizter merged commit 87eca2a into ocaml:main Sep 21, 2026
37 checks passed
@Alizter
Alizter deleted the push-utvssxrmykky branch September 21, 2026 23:26
@Alizter Alizter added this to the 3.25.0 milestone Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants