PostgreSQL is a phenomenal software project, so any press such as this is welcomed. I was irked, however, by this guy's ego. He came off as too 'pats-self-on-the-back' throughout.
I appreciate that he credited Tom Lane and Robert Haas, the end implementors, but they are surely keenly aware of function pointer overhead. I give the post author credit only for taking the time to run the benchmarks and bring it to the community's attention... no small feat, to be sure, but also no David.
It does provide value in drawing light to SortSupport and its implementation.
Incidentally, this is the same reason why sorting in C++ using std::sort is much faster than qsort[1]. Basically, std::sort, which is templated, lets the compiler do the same specialization and inlining that this article talks about.
5 comments
[ 2.7 ms ] story [ 9.1 ms ] threadI appreciate that he credited Tom Lane and Robert Haas, the end implementors, but they are surely keenly aware of function pointer overhead. I give the post author credit only for taking the time to run the benchmarks and bring it to the community's attention... no small feat, to be sure, but also no David.
It does provide value in drawing light to SortSupport and its implementation.
PostgreSQL should really be using a radix sort for these data types, not a quick sort (however "optimized").
[1] http://radiospiel.org/sorting-in-c-3-times-faster-than-c