Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memoize parseMarkdown #702

Closed
wants to merge 1 commit into from
Closed

memoize parseMarkdown #702

wants to merge 1 commit into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Feb 7, 2024

This will make operations such as (re)indexation (#543) and lazy config (#695) much more usable in preview, and might save a few seconds during build (instead of parsing each file 2 or 3 times, we'd do it only once), for example to assist with last-modified (#699) and hashing (#758).

To make sure that we don't inflate the memory requirements I'm capping this arbitrarily to a store that has a maximum of 16^4 shortCode keys — as long as the percentage of conflicts is small the impact on speed is not going to be a problem. (Note: we take care of checking the full hash before deciding to use the cache, so as not to mix two files which would happen to share the same shortCode slot.)

@Fil Fil requested a review from mbostock February 7, 2024 12:37
This was referenced Feb 7, 2024
@Fil
Copy link
Contributor Author

Fil commented Feb 28, 2024

needs to be revisited after #843

@Fil Fil marked this pull request as draft February 28, 2024 21:09
@Fil Fil closed this Mar 15, 2024
@Fil Fil deleted the fil/memoize-parse branch March 15, 2024 08:26
@Fil Fil restored the fil/memoize-parse branch March 15, 2024 08:30
@Fil Fil reopened this Mar 15, 2024
@Fil
Copy link
Contributor Author

Fil commented Mar 15, 2024

mhhh… this might still be useful for #695

@mbostock
Copy link
Member

I’m guessing we don’t need this anymore after recent optimizations?

@Fil
Copy link
Contributor Author

Fil commented Mar 24, 2024

yes!

@Fil Fil closed this Mar 24, 2024
@Fil Fil deleted the fil/memoize-parse branch March 24, 2024 10:34
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.

None yet

2 participants