mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
uv: migrate to rkyv 0.8
Recently, rkyv 0.8 was released. Its API is a fair bit simpler now for higher level uses (like for us in `uv`) and results in us being able to delete a fair bit of code. This also removes our last dependency on `syn 1.0`, and thus drops that dependency. Performance (via testing on the `transformers` example) seems to remain about the same, which is what was expected: ``` $ hyperfine -w5 -r100 'uv lock' 'uv-ag-rkyv-update lock' Benchmark 1: uv lock Time (mean ± σ): 55.6 ms ± 6.4 ms [User: 30.4 ms, System: 35.1 ms] Range (min … max): 43.0 ms … 73.1 ms 100 runs Benchmark 2: uv-ag-rkyv-update lock Time (mean ± σ): 56.5 ms ± 7.2 ms [User: 30.5 ms, System: 36.3 ms] Range (min … max): 39.1 ms … 71.5 ms 100 runs Summary uv lock ran 1.02 ± 0.18 times faster than uv-ag-rkyv-update lock ``` Closes #7415
This commit is contained in:
parent
91a574c6d2
commit
1379b530f6
22 changed files with 203 additions and 437 deletions
|
@ -99,8 +99,7 @@ impl CoreMetadata {
|
|||
rkyv::Deserialize,
|
||||
rkyv::Serialize,
|
||||
)]
|
||||
#[archive(check_bytes)]
|
||||
#[archive_attr(derive(Debug))]
|
||||
#[rkyv(derive(Debug))]
|
||||
#[serde(untagged)]
|
||||
pub enum Yanked {
|
||||
Bool(bool),
|
||||
|
@ -303,8 +302,7 @@ impl FromStr for Hashes {
|
|||
rkyv::Deserialize,
|
||||
rkyv::Serialize,
|
||||
)]
|
||||
#[archive(check_bytes)]
|
||||
#[archive_attr(derive(Debug))]
|
||||
#[rkyv(derive(Debug))]
|
||||
pub enum HashAlgorithm {
|
||||
Md5,
|
||||
Sha256,
|
||||
|
@ -352,8 +350,7 @@ impl std::fmt::Display for HashAlgorithm {
|
|||
rkyv::Deserialize,
|
||||
rkyv::Serialize,
|
||||
)]
|
||||
#[archive(check_bytes)]
|
||||
#[archive_attr(derive(Debug))]
|
||||
#[rkyv(derive(Debug))]
|
||||
pub struct HashDigest {
|
||||
pub algorithm: HashAlgorithm,
|
||||
pub digest: Box<str>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue