[gambit-list] inlining eqv? etc.

Bradley Lucier lucier at math.purdue.edu
Tue Oct 10 13:53:30 EDT 2006


Unification is an algorithm where eqv? is often the slow part in  
Gambit; I fired up schelog with the reverse benchmark and got the  
following.  So inlining eqv? does seem to be worth something.

With r5rs semantics:

without inlining eqv?

[brad:~/Desktop/schelog] lucier% gsi -:m100000 reverse.o1
(time (do ((i 0 (+ i 1))) ((= i 100) (void)) (%which (l) (%reverse  
data l))))
     344 ms real time
     314 ms cpu time (308 user, 6 system)
     no collections
     47933504 bytes allocated
     no minor faults
     no major faults

with inlining eqv?:

[brad:~/Desktop/schelog] lucier% gsi -:m100000 reverse.o2
(time (do ((i 0 (+ i 1))) ((= i 100) (void)) (%which (l) (%reverse  
data l))))
     235 ms real time
     214 ms cpu time (209 user, 5 system)
     no collections
     47933504 bytes allocated
     no minor faults
     no major faults

With r6rs semantics:

No inlining eqv?

[brad:~/Desktop/schelog] lucier% gsi -:m100000 reverse.o4
(time (do ((i 0 (+ i 1))) ((= i 100) (void)) (%which (l) (%reverse  
data l))))
     365 ms real time
     237 ms cpu time (228 user, 9 system)
     no collections
     49325408 bytes allocated
     no minor faults
     no major faults

with inlining eqv?:

[brad:~/Desktop/schelog] lucier% gsi -:m100000 reverse.o3
(time (do ((i 0 (+ i 1))) ((= i 100) (void)) (%which (l) (%reverse  
data l))))
     155 ms real time
     131 ms cpu time (124 user, 7 system)
     no collections
     49325408 bytes allocated
     no minor faults
     no major faults

Just for info, with (standard-bindings)(block)(fixnum)(not safe) (so  
eqv? == eq?)

[brad:~/Desktop/schelog] lucier% gsi -:m100000 reverse.o6
(time (do ((i 0 (+ i 1))) ((= i 100) (void)) (%which (l) (%reverse  
data l))))
     131 ms real time
     106 ms cpu time (99 user, 7 system)
     no collections
     49325728 bytes allocated
     no minor faults
     no major faults




More information about the Gambit-list mailing list