summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hardinfo2/Makefile.in6
-rw-r--r--hardinfo2/arch/common/fib.h24
-rw-r--r--hardinfo2/benchmark.conf6
3 files changed, 19 insertions, 17 deletions
diff --git a/hardinfo2/Makefile.in b/hardinfo2/Makefile.in
index 554f42ba..8a37f674 100644
--- a/hardinfo2/Makefile.in
+++ b/hardinfo2/Makefile.in
@@ -23,6 +23,12 @@ blowfish.o:
sha1.o:
$(CCSLOW) $(CFLAGS) -c sha1.c -o $@
+benchmark.so: benchmark.c
+ @echo "--- Module: $< ($@)"
+ $(CCSLOW) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) \
+ $(GLADE_LIBS) $(GLADE_FLAGS)
+ mv -f $@ modules
+
%.so: %.c
@echo "--- Module: $< ($@)"
$(CC) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) \
diff --git a/hardinfo2/arch/common/fib.h b/hardinfo2/arch/common/fib.h
index a218c90c..7dd4279e 100644
--- a/hardinfo2/arch/common/fib.h
+++ b/hardinfo2/arch/common/fib.h
@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-static unsigned int
-fib(unsigned int n)
+static gulong
+fib(gulong n)
{
if (n == 0)
return 0;
@@ -30,25 +30,21 @@ static gchar *
benchmark_fib(void)
{
GTimer *timer = g_timer_new();
- gdouble elapsed = 1.0;
- gint i;
+ gdouble elapsed;
shell_view_set_enabled(FALSE);
shell_status_update("Calculating the 42nd Fibonacci number...");
- for (i = 0; i < 3; i++) {
- g_timer_reset(timer);
- g_timer_start(timer);
- fib(42); /* the answer? :) */
- g_timer_stop(timer);
- elapsed *= g_timer_elapsed(timer, NULL);
- }
-
- elapsed = pow(elapsed, 1 / 3.0);
+ g_timer_reset(timer);
+ g_timer_start(timer);
+
+ fib(42);
+ g_timer_stop(timer);
+ elapsed = g_timer_elapsed(timer, NULL);
g_timer_destroy(timer);
gchar *retval = g_strdup_printf("[Results <i>(in seconds; lower is better)</i>]\n"
- "<b>This Machine</b>=<b>%.2f</b>\n", elapsed);
+ "<b>This Machine</b>=<b>%.3f</b>\n", elapsed);
return benchmark_include_results(retval, "Fibonacci");
}
diff --git a/hardinfo2/benchmark.conf b/hardinfo2/benchmark.conf
index 2db3f3b8..56297777 100644
--- a/hardinfo2/benchmark.conf
+++ b/hardinfo2/benchmark.conf
@@ -13,10 +13,10 @@ Intel Pentium 75MHz=173.06
[Fibonacci]
# RAM:1024,Board:GA-7NNXP,OS:Linux 2.6.15
-AMD Athlon XP 3200+=6.64
+AMD Athlon XP 3200+=7.34
#AMD Athlon XP 2200+=3.54
-# RAM:512,Board:Toshiba M45-S165,OS:Linux 2.6.15,Compiler:GCC 3.3.5
-Intel Celeron M 1.5GHz=11.10
+# RAM:768,Board:Toshiba M45-S165,OS:Linux 2.6.17,Compiler:GCC 4.1.2
+Intel Celeron M 1.5GHz=8.064
# RAM:128,Board:XingLing,OS:Linux 2.4.20
#Intel Pentium 200MHz=35.02
# RAM:32,Board:Toshiba Libretto 50CT,OS:Linux 2.4.20