Skip to content
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

optimization: don't store bytestring length when it is statically known #2505

Open
charles-cooper opened this issue Oct 22, 2021 · 0 comments
Labels
Optimization Issues related to compiler optimization Refactor Issues related to refactoring the codebase

Comments

@charles-cooper
Copy link
Member

Simple Summary

The runtime format of a bytestring is like

<len 32 bytes> | < bytestring data>

Don't store the length in memory at runtime if length is statically known, as is known for constants and maybe some other cases.

Motivation

We can improve codesize and memory usage if we don't store the length at runtime if it's statically known. Also this will allow us to store constant bytestrings in the upcoming data section just like immutables (cf #2466).

Backwards Compatibility

Not a user-facing change. Could affect tracers but I am not aware of any tools that trace bytestring constants.

Dependencies

#2466

References

Copyright

Copyright and related rights waived via CC0

@charles-cooper charles-cooper added Refactor Issues related to refactoring the codebase Optimization Issues related to compiler optimization labels Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Optimization Issues related to compiler optimization Refactor Issues related to refactoring the codebase
Projects
None yet
Development

No branches or pull requests

1 participant