From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrey mirtchovski To: 9fans@cse.psu.edu Subject: Re: [9fans] GCC3.0 [Was; Webbrowser] In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 5 Feb 2003 21:16:59 -0700 Topicbox-Message-UUID: 5051fd3c-eacb-11e9-9e20-41e7f4b1d025 I've actually used gcc to compile something -- a simple cpu and memory benchmark called 'ubench'. I strongly desire such that the 'my OS is faster' flamewars continue on this list, that's why i'm posting a URL to the ubench source and compilation instructions for Plan9 (using the GCC3.0 port). Unfortunately I couldn't be bothered rewriting the benchmark for the native P9 compiler, so 'my compiler is faster' flame warriors will be left dissatisfied. The URL for ubench is: http://www.phystech.com/download/ubench.html to compile under plan9: % gunzip < ubench-0.32.tar.gz | tar xv % cd ubench-0.32 % # edit ubench.c and comment out syslog.h on line 25 % gnu/gsh $ gcc -o ubench signals.c cpubench.c membench.c ubench.c (alternatively, to compile with optimizations, do:) $ gcc -o ubench signals.c cpubench.c membench.c ubench.c -O2 $ ^D % strip ubench % ubench here are the highly scientific results I got: Celeron 900mhz (average ~40,000 in FreeBSD 4.7 w/ gcc2.95), the machine is a standalone 9pcdisk/kfs terminal: no optimizations: % ubench Unix Benchmark Utility v.0.3 Copyright (C) July, 1999 PhysTech, Inc. Author: Sergei Viznyuk http://www.phystech.com/download/ubench.html Plan9 1 0 generic pcdisk Ubench CPU: 23072 Ubench MEM: 14221 -------------------- Ubench AVG: 18646 % with -O2: % ubench Unix Benchmark Utility v.0.3 Copyright (C) July, 1999 PhysTech, Inc. Author: Sergei Viznyuk http://www.phystech.com/download/ubench.html Plan9 1 0 generic pcdisk Ubench CPU: 24992 Ubench MEM: 18097 -------------------- Ubench AVG: 21544 % Pentium 4, 2Ghz (average ~60,000 on FreeBSD 4.7 w/ gcc2.95, now the machine has FBSD 5.0 w/ gcc3.2 on it, but is booted in p9 so I couldn't test :), the machine is running as an auth/cpu/kfs server: cpu% ubench Unix Benchmark Utility v.0.3 Copyright (C) July, 1999 PhysTech, Inc. Author: Sergei Viznyuk http://www.phystech.com/download/ubench.html Plan9 1 0 generic pcauth Ubench CPU: 39110 Ubench MEM: 33350 -------------------- Ubench AVG: 36230 cpu% with -O2: cpu% ubench Unix Benchmark Utility v.0.3 Copyright (C) July, 1999 PhysTech, Inc. Author: Sergei Viznyuk http://www.phystech.com/download/ubench.html Plan9 1 0 generic pcauth Ubench CPU: 43528 Ubench MEM: 44170 -------------------- Ubench AVG: 43849 cpu% And something else: I just checked how ubench is compiled on freebsd (what optimizations are used) and gave the same arguments to plan9's gcc. The result is: $ gcc -o ubench signals.c cpubench.c membench.c ubench.c -O2 -Wall '-malign-loops=2' '-malign-jumps=2' '-malign-functions=2' -fomit-frame-pointer -s cpu% strip ubench cpu% ubench Unix Benchmark Utility v.0.3 Copyright (C) July, 1999 PhysTech, Inc. Author: Sergei Viznyuk http://www.phystech.com/download/ubench.html Plan9 1 0 generic pcauth Ubench CPU: 43863 Ubench MEM: 44170 -------------------- Ubench AVG: 44016 cpu% as with everything, those results should not be taken too seriously :) andrey