Actions

Difference between revisions of "Benchmarks-watcom"

From Gambit wiki

Line 1: Line 1:
Comparison of Watcom to mingw-prebuilt for Gambit-v4.1.2. Note that the benchmarks supplied with the distribution  were not intended to be run standalone so I have bypassed the prefixes.  Clearly, GCC is significantly faster than Watcom.
+
<texinfo aa=11 bb=22>
<pre>
+
@deffn procedure fixnum-overflow-exception? @var{obj}
gsi puzzle.scm  ; watcom
+
@deffnx procedure fixnum-overflow-exception-procedure @var{exc}
(time (start))
+
@deffnx procedure fixnum-overflow-exception-arguments @var{exc}
     4567 ms real time
+
 
    4567 ms cpu time (4567 user, 0 system)
+
Fixnum-overflow-exception objects are raised by some of the fixnum
    61 collections accounting for 230 ms real time (230 user, 0 system)
+
specific procedures when the result is larger than can fit in a
    30940760 bytes allocated
+
fixnum.  The parameter @var{exc} must be a fixnum-overflow-exception
    no minor faults
+
object.
    no major faults
+
 
 +
The procedure @code{fixnum-overflow-exception?} returns
 +
@code{#t} when @var{obj} is a fixnum-overflow-exception
 +
object and @code{#f} otherwise.
 +
 
 +
The procedure @code{fixnum-overflow-exception-procedure}
 +
returns the procedure that raised @var{exc}.
 +
 
 +
The procedure @code{fixnum-overflow-exception-arguments}
 +
returns the list of arguments of the procedure that raised @var{exc}.
 +
 
 +
For example:
 +
 
 +
@smallexample
 +
> @b{(define (handler exc)                                                     
 +
    (if (fixnum-overflow-exception? exc)                                       
 +
        (list (fixnum-overflow-exception-procedure exc)                       
 +
              (fixnum-overflow-exception-arguments exc))                      
 +
        'not-fixnum-overflow-exception))}
 +
> @b{(with-exception-catcher                                                   
 +
     handler                                                                   
 +
    (lambda () (fx* 100000 100000)))}
 +
(#<procedure #2 fx*> (100000 100000))
 +
@end smallexample
 +
 
 +
@end deffn
 +
 
 +
@deffn {special form} time @r{@i{expr}}
 +
 
 +
The @code{time} special form evaluates @i{expr} and returns the
 +
result.  As a side effect it displays a message on the interaction
 +
channel which indicates how long the evaluation took (in real time and
 +
cpu time), how much time was spent in the garbage collector, how much
 +
memory was allocated during the evaluation and how many minor and
 +
major page faults occured (0 is reported if not running under UNIX).
 +
 
 +
For example:
  
Microsoft Windows XP [Version 5.1.2600]
+
@frog
(C) Copyright 1985-2001 Microsoft Corp.
 
  
C:\gt>gsi puzzle ; (mingw)
+
@smallexample
(time (start))
+
> @b{(define (f x)                                                             
     2995 ms real time
+
    (let loop ((x x) (lst '()))
     2994 ms cpu time (2994 user, 0 system)
+
      (if (= x 0)
     61 collections accounting for 220 ms real time (220 user, 0 system)
+
          lst
     30940760 bytes allocated
+
          (loop (- x 1) (cons x lst)))))}
 +
> @b{(length (time (f 100000)))}
 +
(time (f 100000))
 +
     683 ms real time
 +
     558 ms cpu time (535 user, 23 system)
 +
     8 collections accounting for 102 ms real time (70 user, 5 system)
 +
     6400160 bytes allocated
 
     no minor faults
 
     no minor faults
 
     no major faults
 
     no major faults
 +
100000
 +
@end smallexample
  
C:\gt>gsi graphs ;mingw
+
@end deffn
(time (run 5))
 
    1161 ms real time
 
    1162 ms cpu time (1162 user, 0 system)
 
    98 collections accounting for 380 ms real time (381 user, 0 system)
 
    41479048 bytes allocated
 
  
C:\gt>gsi graphs.scm ;watcom
+
</texinfo>
(time (run 5))
 
    1593 ms real time
 
    1592 ms cpu time (1592 user, 0 system)
 
    98 collections accounting for 541 ms real time (541 user, 0 system)
 
    41479896 bytes allocated
 
</pre>
 

Revision as of 17:55, 1 December 2008

<texinfo aa=11 bb=22> @deffn procedure fixnum-overflow-exception? @var{obj} @deffnx procedure fixnum-overflow-exception-procedure @var{exc} @deffnx procedure fixnum-overflow-exception-arguments @var{exc}

Fixnum-overflow-exception objects are raised by some of the fixnum specific procedures when the result is larger than can fit in a fixnum. The parameter @var{exc} must be a fixnum-overflow-exception object.

The procedure @code{fixnum-overflow-exception?} returns @code{#t} when @var{obj} is a fixnum-overflow-exception object and @code{#f} otherwise.

The procedure @code{fixnum-overflow-exception-procedure} returns the procedure that raised @var{exc}.

The procedure @code{fixnum-overflow-exception-arguments} returns the list of arguments of the procedure that raised @var{exc}.

For example:

@smallexample > @b{(define (handler exc)

   (if (fixnum-overflow-exception? exc)                                        
       (list (fixnum-overflow-exception-procedure exc)                         
             (fixnum-overflow-exception-arguments exc))                        
       'not-fixnum-overflow-exception))}

> @b{(with-exception-catcher

   handler                                                                     
   (lambda () (fx* 100000 100000)))}

(#<procedure #2 fx*> (100000 100000)) @end smallexample

@end deffn

@deffn {special form} time @r{@i{expr}}

The @code{time} special form evaluates @i{expr} and returns the result. As a side effect it displays a message on the interaction channel which indicates how long the evaluation took (in real time and cpu time), how much time was spent in the garbage collector, how much memory was allocated during the evaluation and how many minor and major page faults occured (0 is reported if not running under UNIX).

For example:

@frog

@smallexample > @b{(define (f x)

   (let loop ((x x) (lst '()))
     (if (= x 0)
         lst
         (loop (- x 1) (cons x lst)))))}

> @b{(length (time (f 100000)))} (time (f 100000))

   683 ms real time
   558 ms cpu time (535 user, 23 system)
   8 collections accounting for 102 ms real time (70 user, 5 system)
   6400160 bytes allocated
   no minor faults
   no major faults

100000 @end smallexample

@end deffn

</texinfo>