Skip to content

Commit

Permalink
Add comment regarding to_full()
Browse files Browse the repository at this point in the history
'#273' gave us the hint that chromium ls-remote can be fairly expensive.
It may be better to use the pdfium-binaries VERSION file where
available. We might want to pick this idea.

Note, this does not mean it would be straightforward to take an offline
archive. It'd still need a new target, new env vars, handling down
parameters, changing headers integration, etc.
Since this is a very niche use case, it's cleaner to let callers do the
preprocessing IMO (see #274).

Thanks-to: nh2

(PR in quotes to work around
git-cola/git-cola#1330)
mara004 committed Nov 7, 2023
1 parent a4fc943 commit 44946e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setupsrc/pypdfium2_setup/packaging_base.py
Original file line number Diff line number Diff line change
@@ -130,6 +130,9 @@ def get_latest():
@classmethod
def to_full(cls, v_short, type=dict):

# FIXME The ls-remote call is fairly expensive. While cached in memory for a process lifetime, it can cause a significant slowdown for consecutive process runs.
# There may be multiple ways to improve this, like adding a disk cache to ensure it would only be called once for a whole session, or adding a second strategy that would parse the pdfium-binaries VERSION file, and use the chromium refs only for sourcebuild.

v_short = int(v_short)
rc = cls._refs_cache

0 comments on commit 44946e2

Please sign in to comment.