Re: Inlining comparators as a performance optimisation
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Peter Geoghegan <peter@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2011-11-21T22:55:18Z
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 Tue, Sep 20, 2011 at 7:53 PM, Peter Geoghegan <peter@2ndquadrant.com> wrote: > I don't think that the fact that that happens is at all significant at > this early stage, and it never even occurred to me that you'd think > that it might be. I was simply disclosing a quirk of this POC patch. > The workaround is probably to use a macro instead. For the benefit of > those that didn't follow the other threads, the macro-based qsort > implementation, which I found to perform significantly better than > regular qsort(), runs like this on my laptop when I built at 02 with > GCC 4.6 just now: > > C stdlib quick-sort time elapsed: 2.092451 seconds > Inline quick-sort time elapsed: 1.587651 seconds Results on my machine, for what they're worth: [rhaas inline_compar_test]$ gcc -O0 qsort-inline-benchmark.c [rhaas inline_compar_test]$ ./a.out C stdlib quick-sort time elapsed: 2.366762 seconds Inline quick-sort time elapsed: 1.807951 seconds [rhaas inline_compar_test]$ gcc -O1 qsort-inline-benchmark.c [rhaas inline_compar_test]$ ./a.out C stdlib quick-sort time elapsed: 1.970473 seconds Inline quick-sort time elapsed: 1.002765 seconds [rhaas inline_compar_test]$ gcc -O2 qsort-inline-benchmark.c [rhaas inline_compar_test]$ ./a.out C stdlib quick-sort time elapsed: 1.966408 seconds Inline quick-sort time elapsed: 0.958999 seconds [rhaas inline_compar_test]$ gcc -O3 qsort-inline-benchmark.c [rhaas inline_compar_test]$ ./a.out C stdlib quick-sort time elapsed: 1.988693 seconds Inline quick-sort time elapsed: 0.975090 seconds -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company