Skip to content

without_extras is slow for lerobot #10430

@konstin

Description

@konstin

Given this pyproject.toml, we spend ~38% of resolver thread time in without_extras

Image

Hot code paths:

// In the branches, we "sort" the preferences by marker-matching through an iterator that
// first has the matching half and then the mismatching half.
let preferences_match = preferences
.get(package_name)
.filter(|(marker, _index, _version)| env.included_by_marker(marker.pep508()));

MarkerTree(INTERNER.lock().without_extras(self.0))

Profiling command, on ubuntu 24.04:

cargo build --profile profiling
rm -f uv.lock
samply record --rate 20000 target/profiling/uv lock -p 3.12

We should improve the performance for lerobot.

Metadata

Metadata

Assignees

Labels

performancePotential performance improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions