Such a small benchmark

Ian Piumarta ian.piumarta at inria.fr
Wed Oct 16 17:04:31 UTC 2002


On Wed, 16 Oct 2002, Viktor wrote:

> Such a small benchmark:
> Visual C++ (see code bellow) 
>  ... 14 ms ... 31 %

2 GHz Pentium Whatever:

   15254 (microseconds)

Not quite as fast, but mine is interpreted.  :^p)
Script appended.

Ian


#!/usr/local/bin/uvm

(require 'timeval)

(define gettimeofday (system.dlsym 0 "gettimeofday"))
(define tv0          (timeval.malloc))
(define tv1          (timeval.malloc))

(gettimeofday tv0 0)

(let ([a (system.malloc 4)]
      [i 10000000])
  (while (set! i (- i 1))
    (set! (word a 0) 3)))

(gettimeofday tv1 0)

(let ([t0 (+ (* 1000000 (timeval.sec tv0)) (timeval.usec tv0))]
      [t1 (+ (* 1000000 (timeval.sec tv1)) (timeval.usec tv1))])
  (system.printf "%d\n" (- t1 t0)))




More information about the Squeak-dev mailing list