Re: Double sorting split patch
Peter Geoghegan <peter@2ndquadrant.com>
From: Peter Geoghegan <peter@2ndquadrant.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-09-17T20:09:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix contrib/seg's GiST picksplit method.
- 2a6ebe70fb2f 9.1.0 cited
-
Some copy editing of pg_read_binary_file() patch.
- 290f1603b420 9.1.0 cited
On 15 September 2011 19:46, Alexander Korotkov <aekorotkov@gmail.com> wrote: > Proposed algorithm finds following splits by single pass on two arrays: one > sorted by lower bound of interval and another sorted by upper bound of > interval. Have you considered if further performance improvements could come from providing a qsort implementation that allows for the inlining of the comparator? I find it curious that we go to the trouble of providing a custom qsort implementation in qsort.c, pg_qsort, but haven't gone one step further and considered inlining effects. Here's a macro-based inlining implementation: http://www.corpit.ru/mjt/qsort.html I wondered in passing if compiler vendors had got around to figuring out a way of solving the "inlining function pointer" problem that I first read about years ago, so I ran this code, which benchmarks the macro-based qsort above: http://www.lemoda.net/c/inline-qsort-example/index.html It's actually C++, but that isn't significant (c stdlib qsort() is called). When I built this code with GCC 4.5, the results were: C quick-sort time elapsed: 3.24 Inline C quick-sort time elapsed: 2.01 It looks like this is something that could be revisited. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services