You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The largest current memory-inefficiency when doing an encode involves an extra copy across the Rust-to-Elixir boundary to convert the final encoded Rust string to an Elixir binary. This can potentially be avoided by allocating erlang binaries as the backing store of the destination vector, instead of a Rust byte array. The final binary can just be passed directly to the BEAM and used without an additional copy. There's probably some computational overhead with allocating erlang binaries instead of byte arrays to back the vector, which will need to be compared against the advantage of halving the allocations.
I think there's a good chance this ends up being a net positive, but it needs testing.
The text was updated successfully, but these errors were encountered:
The largest current memory-inefficiency when doing an encode involves an extra copy across the Rust-to-Elixir boundary to convert the final encoded Rust string to an Elixir binary. This can potentially be avoided by allocating erlang binaries as the backing store of the destination vector, instead of a Rust byte array. The final binary can just be passed directly to the BEAM and used without an additional copy. There's probably some computational overhead with allocating erlang binaries instead of byte arrays to back the vector, which will need to be compared against the advantage of halving the allocations.
I think there's a good chance this ends up being a net positive, but it needs testing.
The text was updated successfully, but these errors were encountered: