Looking at the syscalls in more depth, I wrote a small and simple
program that _only_ does syscalls in a big loop, see attachment. Just
uncomment the syscall that you want to benchmark.
Here are the results for Suse 10.0, 10.2 (rescue system) and 10.3.
Hopefully I get the table right this time...
10.0 10.2 10.3
----- ----- -----
gethostname 8.57 11.77 14.47 seconds/run
stat 14.49 19,38 21.90 seconds/run
getuid 2.78 5.43 8.41 seconds/run
close(dup) 9.09 15.83 21.93 seconds/run
Looks like syscalls have been getting slower over time. I'm just amazed
_how_ much slower this is. Did the same thing happen for the vanilla kernel?
Regards
nordi
#include <stdio.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
int main() {
int i;
uid_t myuid;
struct stat x;
char name[5];
for(i=0;i<20000000;i++) {
//gethostname(name, 1);
//stat("/", &x);
//myuid=getuid();
close(dup(0));
}
return 0;
}