shyamd / mkdocs-bibtex

A MkDocs plugin for citation management using bibtex
Other
79 stars 21 forks source link

Skip building bib_data if files are older than config time (for mkdocs serve) #240

Closed mdbenito closed 7 months ago

mdbenito commented 8 months ago

This PR is a continuation to #238.

The speedup is only noticeable after merging #238, but with both PRs together, our re-build using mkdocs serve goes from ~41secs to ~25 secs, or a 40% total reduction in build time. This makes working on documentation much nicer :)

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 96.20%. Comparing base (1496fab) to head (696189d). Report is 4 commits behind head on main.

Files Patch % Lines
src/mkdocs_bibtex/plugin.py 55.55% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #240 +/- ## ========================================== - Coverage 97.97% 96.20% -1.78% ========================================== Files 3 3 Lines 198 211 +13 ========================================== + Hits 194 203 +9 - Misses 4 8 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mdbenito commented 7 months ago

@shyamd I see the errors. Sorry about that. I'll look into it and get back to you

shyamd commented 7 months ago

Thanks for all these performance improvements and no worries on the failing tests. Took me awhile to turn on tests for your PRs.

shyamd commented 7 months ago

I re-named the attribute that you used for holding the last config time. The fact that it wasn't throwing an AttributeError tells me that mkdocs was already using it. This new attribute throws an AttributeError if you don't use the hasattr guard, which is what we'd hope.

shyamd commented 7 months ago

Thanks for all these performance improvements. Next minor version bump will include them.

mdbenito commented 7 months ago

My pleasure. Thank you for the plugin!