News for hackers. Stuff that matters.
Re:Performance Showdown: Rust vs Javascript (2020) by __s on Friday February 12, 2021 @07:04AM (#26112762)
> char is a primitive value that resides on the stack and CPU registers

This is inaccurate. Vec<char> will store chars on the heap. & the concept of primitive values exists in Java, whereas in Rust any struct you declare can exist on the stack (or in CPU registers if the optimizer decides to)

But yes, char is a 32 bit integer as opposed to String being a Vec<u8> under the wraps, & Vec<char> is preferable to Vec<Vec<u8>>

There are no comments on this comment yet.