| commit | 2322ce4fd021cf987c4a290f953c4bf66aa8bb1d | [log] [tgz] | 
|---|---|---|
| author | bors <bors@rust-lang.org> | Sun Jun 08 15:26:49 2025 +0000 | 
| committer | bors <bors@rust-lang.org> | Sun Jun 08 15:26:49 2025 +0000 | 
| tree | a3d2f7be34e44a1945f2b9d3de4a6e500896224e | |
| parent | f3d67558d73985d74f771d37d60ba3a0272134c4 [diff] | |
| parent | 2934249ba87c762b8ce7feacc7d16a2d31a278ff [diff] | 
Auto merge of #142095 - joshtriplett:optimize-veccache, r=SparrowLii Simplify and optimize `VecCache`'s `SlotIndex::from_index` Simplify and optimize `SlotIndex::from_index` Break out bucket 0 (containing `idx < 4096`) as an early return, which simplifies the remainder of the function, and allows optimizing the `checked_ilog2` since it can no longer return `None`. This reduces the runtime of `vec_cache::tests::slot_index_exhaustive` (which calls `SlotIndex::from_index` for every `u32`, twice) from ~15.5s to ~13.3s. Separately, simplify the test case as well. (The old and new code passes with the old and new test case.) --- Noticed because `slot_index_exhaustive` stood out as taking unusually long compared to other tests, so I started investigating what it was doing.
rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.
https://rust-analyzer.github.io/book/installation.html
If you want to contribute to rust-analyzer check out the CONTRIBUTING.md or if you are just curious about how things work under the hood, see the Contributing section of the manual.
If you want to use rust-analyzer's language server with your editor of choice, check the manual. It also contains some tips & tricks to help you be more productive when using rust-analyzer.
See the security and privacy sections of the manual.
For usage and troubleshooting requests, please use “IDEs and Editors” category of the Rust forum:
https://users.rust-lang.org/c/ide/14
For questions about development and implementation, join rust-analyzer working group on Zulip:
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer
rust-analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.