Re:Performance Showdown: Rust vs Javascript (2020)
by m1el on Friday February 12, 2021 @10:08AM
(#26114411)
After reading this blog post, I had a question: why doesn't it take less than millisecond in Rust code?
And the answer is that the author allocates a string for each character, and does more allocation by calling to_uppercase/to_lowercase.
There's a hundredfold improvement in speed by using char or u8 to iterate over a string.
[ Parent
| on HN ]
There are no comments on this comment yet.