in reply to Re^8: Can you improve upon my algorithm.
in thread Can you improve upon my algorithm.
On my old home computer it merges at around 3GB/min, 100GB in half an hour.
As it is just a prove of concept, it can only handle records formed by integers of type int64_t.
The meaning of the constants are as follows:
The source files are passed as arguments on the command line, the sorted output is sent to STDOUT. Only tested on Ubuntu 64bits.N = maximum number of files that can be sorted CHUNKSIZE = the per-file memory buffer KEYSIZE = the number of int64_t numbers per record
Update: It is difficult to count the number of instructions inside the loop on the hot path. It is certainly below 100, don't know if I have been able to reach the 50 I have predicted... I blame gcc -O3 for that for unrolling small loops as the key comparison.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Can you improve upon my algorithm.
by BrowserUk (Patriarch) on Mar 14, 2015 at 01:09 UTC | |
by salva (Canon) on Mar 14, 2015 at 07:50 UTC | |
by BrowserUk (Patriarch) on Mar 14, 2015 at 14:14 UTC | |
by BrowserUk (Patriarch) on Mar 14, 2015 at 17:53 UTC |