Message from C, C++ talks

June 2019

— Lol...

— I am actually doing a test against busybox yes vs GNU yes...

— I wonder why and how GNU yes is way faster than busybox yes

— Maybe buffers

— 

B17wiseeula47 ~ % cat yes.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
char yes[2] = {'y', '\n'};
char *buf = malloc(8192);
int buff = 0;
while (buff < 8192) {
memcpy(buf+buff, yes, 2);
buff += 2;
}
while(fwrite(1, buf, 8192));
return 1;
}

— Yea

— This one reach upto 6GBps but GNU still faster

— They do what std::cout does

— By how much?

— 4GBps gaps

— Busybox is snail here.. 190MBps

— Whoa

— Got access to both codes?

— Do a yes| pv >/dev/null

— Yes.. and trying to overtake GNU... but I cant