Re: Inlining comparators as a performance optimisation
Greg Jaskiewicz <gj@pointblue.com.pl>
From: Greg Jaskiewicz <gj@pointblue.com.pl>
To: Peter Geoghegan <peter@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2011-11-29T21:43:40Z
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 →
-
Speed up conversion of signed integers to C strings.
- 4fc115b2e981 9.1.0 cited
-
Remove some unnecessary tests of pgstat_track_counts.
- f4d242ef9473 9.1.0 cited
-
Remove cvs keywords from all files.
- 9f2e21138693 9.1.0 cited
-
Code cleanup for function prototypes: change two K&R-style prototypes
- b9954fbb4ef2 8.3.0 cited
-
Use Min() instead of min() in qsort, for consistency and to avoid
- b38900c76776 8.2.0 cited
-
pgindent run for 8.2.
- f99a569a2ee3 8.2.0 cited
-
Switch over to using our own qsort() all the time, as has been proposed
- 6edd2b4a91bd 8.2.0 cited
On 28 Nov 2011, at 02:15, Peter Geoghegan wrote: > Attached are the results from performing a similar process to the > prior benchmark, but on Greg Smith's high-end server, and with an > orderlines table that has been "doubled-up" until it is 1538 MB, > making the same old query perform a quicksort that's over 3GB. Short > version: HEAD is 20468.0ms, with my patch it's 13689.698ms, so these > gains hold-up very well for very large in-memory sorts, possibly even > perfectly. > This is some really good stuff. Has to be said, that there must be quite few other places where inlining like that could have quite a positive benefit. But - I also have to say that both template functions and template classes in C++ give you pretty much the same speed improvement, with much better clarity and readability of the code. (I've tested it with the example Peter presented, if someone is interested in the code). One more reason why PostgreSQL project should look into the future and get some of the bits simplified and optimised by switching to C++.