-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create SparseRepoData from byte slices #624
feat: create SparseRepoData from byte slices #624
Conversation
7a591a9
to
35a6a41
Compare
Did you profile this with a real-world scenario? Most repodata.json is already sorted but just on a slightly different key therefor I didn't think this would matter much. Im also a little hesitant to add randomness to the repodata.json. I don't think the order of the records in the file matters much but I am not completely sure.
Look at the changes, can we use a |
That's indeed possible (in fact, I had to manually specify the
I haven't profiled it. It's just that the stable version allocates half the size of self, according to the docs, so it feels "more correct". The docs even recommend using I don't think it really matters in practice, so let me know if you'd rather have me drop the commit 😉 |
Lets do that, it feels more ergonomic.
I'm also fairly certain the order doesn't matter. So let's just leave it in. 🙉 |
35a6a41
to
9e0279e
Compare
9e0279e
to
7f5fd6f
Compare
Rebased and figured out how to make the change non-breaking. This is now ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny little comment but otherwise LGTM
7f5fd6f
to
1808eda
Compare
Fixes conda#619 --------- Co-authored-by: Bas Zalmstra <zalmstra.bas@gmail.com>
## 🤖 New release * `rattler_networking`: 0.20.3 -> 0.20.4 (✓ API compatible changes) * `rattler_lock`: 0.22.3 -> 0.22.4 (✓ API compatible changes) * `rattler_repodata_gateway`: 0.19.9 -> 0.19.10 (✓ API compatible changes) * `rattler_index`: 0.19.8 -> 0.19.9 (✓ API compatible changes) * `rattler`: 0.23.1 -> 0.23.2 * `rattler_package_streaming`: 0.20.6 -> 0.20.7 <details><summary><i><b>Changelog</b></i></summary><p> ## `rattler_networking` <blockquote> ## [0.20.4](rattler_networking-v0.20.3...rattler_networking-v0.20.4) - 2024-04-30 ### Other - bump py-rattler 0.5.0 ([#629](#629)) </blockquote> ## `rattler_lock` <blockquote> ## [0.22.4](rattler_lock-v0.22.3...rattler_lock-v0.22.4) - 2024-04-30 ### Added - adds pypi indexes to the lock-file ([#626](#626)) </blockquote> ## `rattler_repodata_gateway` <blockquote> ## [0.19.10](rattler_repodata_gateway-v0.19.9...rattler_repodata_gateway-v0.19.10) - 2024-04-30 ### Added - create SparseRepoData from byte slices ([#624](#624)) </blockquote> ## `rattler_index` <blockquote> ## [0.19.9](rattler_index-v0.19.8...rattler_index-v0.19.9) - 2024-04-30 ### Other - release ([#625](#625)) </blockquote> ## `rattler` <blockquote> ## [0.23.2](rattler-v0.23.1...rattler-v0.23.2) - 2024-04-30 ### Other - updated the following local packages: rattler_networking </blockquote> ## `rattler_package_streaming` <blockquote> ## [0.20.7](rattler_package_streaming-v0.20.6...rattler_package_streaming-v0.20.7) - 2024-04-30 ### Other - updated the following local packages: rattler_networking </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). Signed-off-by: Bas <4995967+baszalmstra@users.noreply.github.com> Co-authored-by: Bas <4995967+baszalmstra@users.noreply.github.com>
This is a breaking change, because it introduces a lifetime parameter forWe ended up usingSparseRepoData
. If that's undesirable, maybe we could create an inner type (e.g.SparseRepoData2
) wrapped by two outer types (e.g.MemmappedSparseRepoData
andByteSliceSparseRepoData
).Bytes
with a self-referential borrow to get rid of the lifetime entirely, so now the change is no longer breaking 🎉.I also took the liberty to switch from stable to unstable sorting, which has better performance characteristics. If you'd rather leave things as they are now, I can drop the commit.
Fixes #619