4 ms·
Sorting improvements in PostgreSQL 9.2: the case for micro-optimisation
- agwa 14y agoIncidentally, 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. [1] http://radiospiel.org/sorting-in-c-3-times-faster-than-c http://radiospiel.org/sorting-in-c-3-times-faster-than-c
- ralph 14y agoDupe of http://news.ycombinator.com/item?id=4327654 http://news.ycombinator.com/item?id=4327654 (thanks to non-canonical URL).
- obtu 14y agoThis submission's title (taken from the blog post) is more interesting.
- user911302966 14y agoPostgreSQL 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.
- saurik 14y ago(Reposting the comment I had left on the other version of this article:) PostgreSQL should really be using a radix sort for these data types, not a quick sort (however "optimized").