I am sorting 128-bit entries in a large file (10 with GB). The algorithm works fine and currently uses uint64_t , and two of them are equal to the same record. This is on a modern 64-bit system.
In the interest of code readability, it is interesting to know whether it is possible to create a structure of type typedef struct u128t {uint64_t hi, uint64_t} u128t instead of two 64-bit records. This will do an array index cleanup and assignment, but I will have to implement a comparator function.
Is this a portable solution and should I expect it to work at the same speed as the original implementation?
Further reading:
performance c sorting algorithm
Full decent
source share