micropip icon indicating copy to clipboard operation
micropip copied to clipboard

double best_compatible_tag_index call ?

Open Carreau opened this issue 1 year ago • 1 comments

I think best_compatible_tag_index is called twice for each wheel in find_wheel;

Indeed, find_wheel calls it directly, but best_compatible_tag_index is also directly used by the various static method returning ProjectInfos, via the ProjectInfo._compatible_only(name, releases) -> ._compatible_wheels -> is_package_compatible -> best_compatible_tag_index(..) is not None.

I think it is likely possible to cache, or carry the tag index along and avoid computing it twice.

Carreau avatar Nov 22 '24 13:11 Carreau

I think it is likely possible to cache,

caching sound good to me.

ryanking13 avatar Nov 23 '24 05:11 ryanking13