Re: qsort_b in Swift
The compiler probably inlines the call to the comparison function, as opposed to qsort_b which has (of course) already been compiled so it has to make a regular function call. That makes a big difference when the function is as cheap as comparing two integers. Similarly, in the Swift code the size of the array elements is a compile-time constant, whereas to qsort_b it's a variable. That results in more efficient code. —Jens
|
|