2 ms·
And reading more closely, beating the competition low level OS knowledge and understanding peculiarities of the benchmark in question. The benchmark was about
by fulafel 5y ago
And reading more closely, beating the competition low level OS knowledge and understanding peculiarities of the benchmark in question.
The benchmark was about getting the output to a pipe as fast as possible, and there's this great pipe speed hack:
// To produce output without losing speed, the program therefore needs
// to avoid copies, or at least do them in parallel with calculating
// the next block of output. This can be accomplished with the
// `vmsplice` system call, which tells the kernel to place a reference
// to a buffer into a pipe (as opposed to copying the data into the
// pipe); the program at the other end of this pipe will then be able
// to read the output directly out of this program's memory, with no
// need to copy the data into kernelspace and then back into
// userspace.