uv/crates
Andrew Gallant 63f7f65190
change global allocator to jemalloc (and mimalloc on Windows) (#399)
This copies the allocator configuration used in the Ruff project. In
particular, this gives us an instant 10% win when resolving the top 1K
PyPI packages:

    $ hyperfine \
"./target/profiling/puffin-dev-main resolve-many --cache-dir
cache-docker-no-build --no-build pypi_top_8k_flat.txt --limit 1000 2>
/dev/null" \
"./target/profiling/puffin-dev resolve-many --cache-dir
cache-docker-no-build --no-build pypi_top_8k_flat.txt --limit 1000 2>
/dev/null"
Benchmark 1: ./target/profiling/puffin-dev-main resolve-many --cache-dir
cache-docker-no-build --no-build pypi_top_8k_flat.txt --limit 1000 2>
/dev/null
Time (mean ± σ): 974.2 ms ± 26.4 ms [User: 17503.3 ms, System: 2205.3
ms]
      Range (min … max):   943.5 ms … 1015.9 ms    10 runs

Benchmark 2: ./target/profiling/puffin-dev resolve-many --cache-dir
cache-docker-no-build --no-build pypi_top_8k_flat.txt --limit 1000 2>
/dev/null
Time (mean ± σ): 883.1 ms ± 23.3 ms [User: 14626.1 ms, System: 2542.2
ms]
      Range (min … max):   849.5 ms … 916.9 ms    10 runs

    Summary
'./target/profiling/puffin-dev resolve-many --cache-dir
cache-docker-no-build --no-build pypi_top_8k_flat.txt --limit 1000 2>
/dev/null' ran
1.10 ± 0.04 times faster than './target/profiling/puffin-dev-main
resolve-many --cache-dir cache-docker-no-build --no-build
pypi_top_8k_flat.txt --limit 1000 2> /dev/null'

I was moved to do this because I noticed `malloc`/`free` taking up a
fairly sizeable percentage of time during light profiling.

As is becoming a pattern, it will be easier to review this
commit-by-commit.

Ref #396 (wouldn't call this issue fixed)

-----

I did also try adding a `smallvec` optimization to the
`Version::release` field, but it didn't bare any fruit. I still think
there is more to explore since the results I observed don't quite line
up with what I expect. (So probably either my mental model is off or my
measurement process is flawed.) You can see that attempt with a little
more explanation here:
f9528b4ecd

In the course of adding the `smallvec` optimization, I also shrunk the
`Version` fields from a `usize` to a `u32`. They should at least be a
fixed size integer since version numbers aren't used to index memory,
and I shrunk it to `u32` since it seems reasonable to assume that all
version numbers will be smaller than `2^32`.
2023-11-10 14:48:59 -05:00
..
bench distribution-filename: speed up is_compatible (#367) 2023-11-09 09:01:03 -05:00
distribution-filename Rename Distribution to Dist in all structs and traits (#384) 2023-11-10 14:55:11 +00:00
gourgeist Remove virtualenv setup from gourgeist (#339) 2023-11-06 18:32:45 +00:00
install-wheel-rs Delete any directories listed in the RECORD file (#394) 2023-11-10 18:17:52 +00:00
pep440-rs change global allocator to jemalloc (and mimalloc on Windows) (#399) 2023-11-10 14:48:59 -05:00
pep508-rs change global allocator to jemalloc (and mimalloc on Windows) (#399) 2023-11-10 14:48:59 -05:00
platform-host fix platform detection on Linux (#359) 2023-11-07 11:39:35 -05:00
platform-tags distribution-filename: speed up is_compatible (#367) 2023-11-09 09:01:03 -05:00
puffin-build Rename Distribution to Dist in all structs and traits (#384) 2023-11-10 14:55:11 +00:00
puffin-cache Add proper caching for pypi metadata fetching kinds (#368) 2023-11-10 11:03:40 +00:00
puffin-cli change global allocator to jemalloc (and mimalloc on Windows) (#399) 2023-11-10 14:48:59 -05:00
puffin-client Add source to failing metadata parsing (#387) 2023-11-10 18:33:49 +00:00
puffin-dev change global allocator to jemalloc (and mimalloc on Windows) (#399) 2023-11-10 14:48:59 -05:00
puffin-dispatch Add source to failing metadata parsing (#387) 2023-11-10 18:33:49 +00:00
puffin-distribution Rename Distribution to Dist in all structs and traits (#384) 2023-11-10 14:55:11 +00:00
puffin-git Refactor distribution types to adhere to a clear hierarchy (#369) 2023-11-10 02:45:41 +00:00
puffin-installer Rename Distribution to Dist in all structs and traits (#384) 2023-11-10 14:55:11 +00:00
puffin-interpreter Make cache non-optional in most crates (#293) 2023-11-02 13:40:20 -04:00
puffin-normalize Split puffin-package into requirements.txt parser and pypi-types (#341) 2023-11-06 18:19:49 +00:00
puffin-resolver change global allocator to jemalloc (and mimalloc on Windows) (#399) 2023-11-10 14:48:59 -05:00
puffin-traits Special case missing header build errors (on linux) (#354) 2023-11-08 15:26:39 +00:00
puffin-workspace Update pyproject-toml to 0.8.0 (#329) 2023-11-06 13:16:36 +00:00
pypi-types Respect direct URLs in puffin installer (#345) 2023-11-07 09:11:27 -05:00
requirements-txt Split puffin-package into requirements.txt parser and pypi-types (#341) 2023-11-06 18:19:49 +00:00
README.md Add source distribution filename abstraction (#154) 2023-10-20 17:45:57 +02:00

Crates

pep440-rs

Utilities for interacting with Python version numbers and specifiers.

pep508-rs

Utilities for interacting with PEP 508 dependency specifiers.

platform-host

Functionality for detecting the current platform (operating system, architecture, etc.).

platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

puffin-cli

Command-line interface for the Puffin package manager.

puffin-client

Client for interacting with PyPI-compatible HTTP APIs.

puffin-installer

Functionality for installing Python packages into a virtual environment.

puffin-interpreter

Functionality for detecting and leveraging the current Python interpreter.

puffin-package

Types and functionality for working with Python packages, e.g., parsing wheel files.

puffin-resolver

Functionality for resolving Python packages and their dependencies.

distribution-filename

Functionality for parsing wheel filenames as per PEP 427.