Speed up in-memory tuplesorting.
Per recent work by Peter Geoghegan, it's significantly faster to tuplesort on a single sortkey if ApplySortComparator is inlined into quicksort rather reached via a function pointer. It's also faster in general to have a version of quicksort which is specialized for sorting SortTuple objects rather than objects of arbitrary size and type. This requires a couple of additional copies of the quicksort logic, which in this patch are generate using a Perl script. There might be some benefit in adding further specializations here too, but thus far it's not clear that those gains are worth their weight in code footprint.
Showing
- src/backend/Makefile 3 additions, 1 deletionsrc/backend/Makefile
- src/backend/utils/sort/.gitignore 1 addition, 0 deletionssrc/backend/utils/sort/.gitignore
- src/backend/utils/sort/Makefile 8 additions, 0 deletionssrc/backend/utils/sort/Makefile
- src/backend/utils/sort/gen_qsort_tuple.pl 232 additions, 0 deletionssrc/backend/utils/sort/gen_qsort_tuple.pl
- src/backend/utils/sort/tuplesort.c 35 additions, 33 deletionssrc/backend/utils/sort/tuplesort.c
- src/port/qsort.c 1 addition, 1 deletionsrc/port/qsort.c
- src/port/qsort_arg.c 1 addition, 1 deletionsrc/port/qsort_arg.c
- src/tools/msvc/Solution.pm 8 additions, 0 deletionssrc/tools/msvc/Solution.pm
Loading
Please register or sign in to comment