0

Rustdoc: use ThinVec for GenericArgs bindings by Kobzol · Pull Request #92395 ·...

 10 months ago
source link: https://github.com/rust-lang/rust/pull/92395
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

Author

Kobzol commented 19 days ago

FWIW, I also tried to go through all Rustdoc clean structures and reduce their sizes by converting all Vec<T> to Box<[T]>, which reduces 24 bytes to 16 bytes.

Sadly, it seems that it increased RSS instead of reducing it, probably because in most cases the Vec still has to be created first, and also because into_boxed_slice can reallocate, which is unfortunate. Something like https://docs.rs/thin-slice/latest/thin_slice/ could be used to reduce the size further to 8 bytes, but I'm afraid that the problems with boxing the slice will prevail.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK