the.bay.news

`Vec ` vs. `String` for a scanner: Which is more performant in Rust?

The Rust Programming Language Forum
`Vec ` vs. `String` for a scanner: Which is more performant in Rust?
When writing an interpreter in Rust, does using Vec<char> or String for the scanner make a difference in terms of performance? Which one would be the better choice? My Code: pub struct Scanner<'a> { source: Vec<char>, tokens: Vec<Token<'a>>, start: usize, current: usize, line: i32, } I'm a hobbyist programmer, and I've always been very interested in compilers. I want to dive deeper into this area as a hobby, so I started with Crafting Interpreters. Along the way, I've also...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.