Open mhofman opened 1 week ago
Latest commit: |
6ca7f17
|
Status: | ✅ Deploy successful! |
Preview URL: | https://fbe1e424.agoric-sdk.pages.dev |
Branch Preview URL: | https://mhofman-optimize-golang-stri.agoric-sdk.pages.dev |
@michaelfig I pushed a few more changes handling []byte
-> string
cases PTAL
closes: #XXXX refs: https://github.com/Agoric/agoric-sdk/pull/9549#pullrequestreview-2133916778
Description
Avoid copies between byte slices and string wherever possible when we need to convert from one to the other. Introduces a couple helpers for the common cases
Security Considerations
All changes were checked to ensure the byte slices are not mutated. The biggest concern would be a use after free, but apparently golang is smart enough to maintain liveness of the raw memory if any golang value (string or byte slice) points into it.
Scaling Considerations
Should avoid unnecessary copies, some in hot paths
Documentation Considerations
None
Testing Considerations
Will put this change through a genesis export / import stress test.
Upgrade Considerations
None, but would be good to include in u16