Skip to content

Implement caching for PersonIndex - #5782

Draft
mbollmann wants to merge 1 commit into
masterfrom
python-cache-peopleindex
Draft

Implement caching for PersonIndex#5782
mbollmann wants to merge 1 commit into
masterfrom
python-cache-peopleindex

Conversation

@mbollmann

Copy link
Copy Markdown
Member

First attempt at implementing caching for the library, targeting PersonIndex.

In my testing, calling anthology.people.load() takes ca. 7 seconds when building from the XML files, and ~1.5 seconds when loading from the cache file.

However, when calling anthology.load_all(), the difference is much less pronounced — maybe it's worth testing how much Collection objects would profit from caching as well.

Finally, I encountered some issues during local testing where occasionally the cache file would be loaded even though it was empty, so despite the existing tests there are some more kinks to be ironed out.

@mbollmann mbollmann added the python-library Concerning the acl-anthology-py library label Aug 19, 2025
@codecov

codecov Bot commented Aug 19, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.32%. Comparing base (d4c7d10) to head (9b57e12).
⚠️ Report is 1167 commits behind head on master.

Files with missing lines Patch % Lines
python/acl_anthology/people/index.py 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5782      +/-   ##
==========================================
+ Coverage   95.28%   95.32%   +0.03%     
==========================================
  Files          35       35              
  Lines        3031     3077      +46     
==========================================
+ Hits         2888     2933      +45     
- Misses        143      144       +1     
Files with missing lines Coverage Δ
python/acl_anthology/anthology.py 89.94% <100.00%> (+0.56%) ⬆️
python/acl_anthology/collections/collection.py 98.41% <ø> (-0.02%) ⬇️
python/acl_anthology/config.py 100.00% <100.00%> (ø)
python/acl_anthology/people/name.py 98.01% <ø> (ø)
python/acl_anthology/people/person.py 100.00% <100.00%> (ø)
python/acl_anthology/people/index.py 97.61% <96.96%> (-0.09%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mjpost

mjpost commented Aug 20, 2025

Copy link
Copy Markdown
Member

Just request the review when you want it.

@nschneid

Copy link
Copy Markdown
Collaborator

@mbollmann Can this be closed?

@mbollmann

Copy link
Copy Markdown
Member Author

This exact PR may be out of date but the functionality is still very much at the top of my wishlist, so this would be good to keep around until I know which parts of this can be scrapped or re-used.

Base automatically changed from python-dev to master March 25, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python-library Concerning the acl-anthology-py library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants