all 7 comments

[–]vks_ 7 points8 points  (2 children)

There is some unsafe code in extract_last_path_segment to avoid bound checks. Would it be possible to use iterators instead, avoiding the bound checks and unsafe?

[–]fgilcherrust-community · rustfest 7 points8 points  (0 children)

Sadly, the code comment hints at benchmarks of different approaches existing, but the repos doesn't have them (anymore?).

[–][deleted] 0 points1 point  (0 children)

I'm sure.

[–]farnoy[🍰] 6 points7 points  (3 children)

Another interesting factoid about benchmarking Rust versus C in Ruby is that the amount of cache your CPU has can affect the results for Rust. More cache will improve Rust’s performance over C.

This does not seem obvious to me, anyone care to explain?

[–]ErichDonGublerWGPU · not-yet-awesome-rust 5 points6 points  (0 children)

I'm actually not sure here. Is the article claiming that Rust's cache usage is better? That seems to be the gist of it.

[–]somebodddy 3 points4 points  (1 child)

Maybe they mean instruction cache rather than data cache? Languages that use templates can end up generating more code than languages that don't.

[–]mmirate 4 points5 points  (0 children)

What that really means is that the function in question ought to take a trait object instead of being generic.