这是indexloc提供的服务,不要输入任何密码
Skip to content

Speed up NoMoveVec allocations #2398

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

Merged
merged 2 commits into from
Oct 27, 2022
Merged

Speed up NoMoveVec allocations #2398

merged 2 commits into from
Oct 27, 2022

Conversation

alexkirsz
Copy link
Contributor

This speeds up NoMoveVec allocations by ensuring that new bucket initialization is just as fast as calloc. Before, we would initialize everything as Option<T>::None, which is not guaranteed to match a zeroed value because of niche optimization[1]. This comes at the cost of slightly higher memory usage, but that should be more than offset by #2395.

[1] https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e60c0bfa4d32a3609fd39299a1c79c29

@vercel
Copy link

vercel bot commented Oct 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
examples-basic-web ✅ Ready (Inspect) Visit Preview Oct 27, 2022 at 1:36AM (UTC)
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview Oct 27, 2022 at 1:36AM (UTC)
examples-native-web ✅ Ready (Inspect) Visit Preview Oct 27, 2022 at 1:36AM (UTC)
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Oct 27, 2022 at 1:36AM (UTC)
2 Ignored Deployments
Name Status Preview Comments Updated
examples-designsystem-docs ⬜️ Ignored (Inspect) Oct 27, 2022 at 1:36AM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Oct 27, 2022 at 1:36AM (UTC)

@alexkirsz alexkirsz added the pr: automerge Kodiak will merge these automatically after checks pass label Oct 27, 2022
@kodiakhq kodiakhq bot merged commit 667a0ad into main Oct 27, 2022
@kodiakhq kodiakhq bot deleted the alexkirsz/faster-no-move-vec branch October 27, 2022 01:49
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
This speeds up `NoMoveVec` allocations by ensuring that new bucket initialization is just as fast as `calloc`. Before, we would initialize everything as `Option<T>::None`, which is not guaranteed to match a zeroed value because of niche optimization[1]. This comes at the cost of slightly higher memory usage, but that should be more than offset by vercel/turborepo#2395.

[1] https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e60c0bfa4d32a3609fd39299a1c79c29
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
This speeds up `NoMoveVec` allocations by ensuring that new bucket initialization is just as fast as `calloc`. Before, we would initialize everything as `Option<T>::None`, which is not guaranteed to match a zeroed value because of niche optimization[1]. This comes at the cost of slightly higher memory usage, but that should be more than offset by vercel/turborepo#2395.

[1] https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e60c0bfa4d32a3609fd39299a1c79c29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants