Measure only what is significant in the partitioning procedure.
Measure time to run the actual workload after sampling. And some minor cleanups.
Measure the sampling time.
Pass the number of records to sort as an argument.
Do bandwidth measurements in MBytes per second.
Uninitialized variables and their pain.