Darrick J. Wong c390c64503 xfs: convert xfarray insertion sort to heapsort using scratchpad memory
In the previous patch, we created a very basic quicksort implementation
for xfile arrays.  While the use of an alternate sorting algorithm to
avoid quicksort recursion on very small subsets reduces the runtime
modestly, we could do better than a load and store-heavy insertion sort,
particularly since each load and store requires a page mapping lookup in
the xfile.

For a small increase in kernel memory requirements, we could instead
bulk load the xfarray records into memory, use the kernel's existing
heapsort implementation to sort the records, and bulk store the memory
buffer back into the xfile.  On the author's computer, this reduces the
runtime by about 5% on a 500,000 element array.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Kent Overstreet <kent.overstreet@linux.dev>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2023-08-10 07:48:05 -07:00
..
2023-08-10 07:48:04 -07:00
2022-01-15 16:30:29 +02:00
2021-10-22 16:00:31 -07:00
2023-01-19 09:24:28 +01:00
2023-06-29 13:23:32 -07:00
2023-07-09 09:50:42 -07:00
2023-02-20 11:53:11 -08:00
2023-06-26 12:47:20 -07:00
2023-06-29 13:23:32 -07:00
2022-05-11 17:01:22 +10:00
2023-07-05 14:08:03 -07:00
2021-08-19 10:07:14 -07:00
2023-03-06 09:57:12 +01:00