Skip to content

Why does rustc_serialize use uleb128 to encode all integers? #68779

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

Closed
bjorn3 opened this issue Feb 2, 2020 · 0 comments · Fixed by #92314
Closed

Why does rustc_serialize use uleb128 to encode all integers? #68779

bjorn3 opened this issue Feb 2, 2020 · 0 comments · Fixed by #92314
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Feb 2, 2020

Especially for small integers like u16, the memory save is likely very small, while the extra instructions likely result in a slowdown.

fn emit_u16(&mut self, v: u16) -> EncodeResult {
write_uleb128!(self, v, write_u16_leb128)
}

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 2, 2020
@bors bors closed this as completed in 399ba6b Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants