My name is Emanuel Carnevale, I write about software and technology, I also keep another tumblelog An onigiri a day and take pictures.
Emanuel Carnevale's Blog
March 27, 2009
A pass through the MRI source code reveals that the the Array.sort! is implemented via quicksort. And while the benchmarks do show a four times performance hit when compared to the raw C++ version sorting an array of integers, you have to remember that an equivalent implementation in Ruby is operating on array of integer objects! In other words, native Array.sort! is a highly optimized piece of code: use it, embrace it, and don’t worry about it!