News for hackers. Stuff that matters.
Re:Performance Showdown: Rust vs Javascript (2020) by hedora on Friday February 12, 2021 @12:18PM (#26115979)
Popping from the source is likely a big source of allocator / copy overhead. It’s probably better to just iterate over an input array.

The algorithm in the article would be quadratic in perl 5; not sure about rust or js, but the point still stands: It’s likely to see asymptotic performance differences in different languages.

(Edit: it’s not quadratic in perl. If it used shift to pull from the front of the array it would be.)

Re:Performance Showdown: Rust vs Javascript (2020) by Measter on Saturday February 13, 2021 @03:08AM (#26122176)
Popping doesn't touch the allocator, as it doesn't resize the backing storage. The only thing being copied is the String struct (24 bytes), which while unnecessarily large here, wouldn't be the bottleneck.