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

[FEATURE] Improve git commit time lookup performance with memoization #42

Closed
RichardForshaw opened this issue Jan 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@RichardForshaw
Copy link

Is your feature request related to a problem? Please describe.
Based on my mkdocs configuration, the publish date for my blog articles are generated multiple times. As the list of articles grows, the build time becomes longer and longer, and git.log is already a bit slow...

Describe the solution you'd like
This can be sped up with memoisation - using the functools.cache decorator (from python 3.9) or similar on the git_get_commit_timestamp function means that the subsequent 2 calls on the same file return instantaneously. A brief test has already cut my build time by over 50%.

Describe alternatives you've considered
I've looked into speeding up git.log but can't find anything useful.

@liang2kl
Copy link
Owner

liang2kl commented Jan 2, 2023

Good suggestion! Can you create a PR for this?

@liang2kl liang2kl added the enhancement New feature or request label Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants