Re:Neat Rust Tricks: Passing Closures to C
by 0db532a0 on Tuesday November 26, 2019 @03:06AM
(#21636412)
Gets me thinking: I wonder how good Intel CPUs are with dealing with this sort of thing. Can the CPU detect repeated jumps to comparators and in-line them from there? I’d be interested to see a comparative benchmark.
(qsort is really only for C. Other languages can potentially inline the comparison function, so using FFI for that is kind of insane.)