gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Faster equal, 11% for Boyer (was Re: bees for bonnets)


From: Camm Maguire
Subject: [Gcl-devel] Faster equal, 11% for Boyer (was Re: bees for bonnets)
Date: Tue, 19 Jun 2007 23:10:35 -0400

Bob, if you might recall, we discussed the performance degradation of
equal in 2.7.0 that had been introduced by the introduction of two
word conses and immediate fixnums.  In spite of the assumed dominance
of memory access times in traversing large lists, and the therefore
assumed negligible cost of the extra checking for the lack of a type
word, and the presence of an immediate fixnum, 2.7.0 equal has had a
10-20% overhead vis a vis 2.6.x.  This is the overwhelming factor in
the nqthm regression times -- it was quite suprising to observe that
in spite of 2.7.0 getting all the fast links right, the game was over
if we lost anything at all on equal.  As I'm trying to get 2.7.0 into
release shape by September, I need to make sure that at very least it
is not slower on the existing applications.

In sum, I've redone equal, eql and equalp so that they are faster
than 2.6.x in spite of the extra checking.  This is only possible due
to the "branch prediction" aspects of modern cpus which are still
somewhat mysterious to me:
=============================================================================
machine1
=============================================================================
address@hidden:/fix/t1/camm/debian/gcl/tmp/tmp/foo1$ gcl
GCL (GNU Common Lisp)  2.6.8 CLtL1    May 16 2007 13:43:22
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/

>(setq a (make-list 10000) b (make-list 10000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.160 secs
run-gbc time    :      0.170 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.120 secs
run-gbc time    :      0.130 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.170 secs
run-gbc time    :      0.170 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.120 secs
run-gbc time    :      0.130 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(setq a (make-list 10000) b (make-list 10000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.110 secs
run-gbc time    :      0.110 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.110 secs
run-gbc time    :      0.110 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.150 secs
run-gbc time    :      0.160 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>
address@hidden:/fix/t1/camm/debian/gcl/tmp/tmp/foo1$ 
address@hidden:/fix/t1/camm/debian/gcl/tmp/tmp/foo1$ unixport/saved_gcl
GCL (GNU Common Lisp)  2.7.0 CLtL1    Jun 19 2007 17:08:06
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.

Temporary directory for compiler files set to /tmp/

>(setq a (make-list 10000) b (make-list 10000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.250 secs
run-gbc time    :      0.250 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.220 secs
run-gbc time    :      0.230 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.210 secs
run-gbc time    :      0.210 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.220 secs
run-gbc time    :      0.220 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.210 secs
run-gbc time    :      0.210 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(setq a (make-list 10000) b (make-list 10000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.040 secs
run-gbc time    :      0.040 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.040 secs
run-gbc time    :      0.040 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.050 secs
run-gbc time    :      0.050 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>
=============================================================================
machine2
=============================================================================
address@hidden:/nfs/i19/t1/camm/debian/gcl/nqt$ 
address@hidden:/nfs/i19/t1/camm/debian/gcl/nqt$ ./s6
GCL (GNU Common Lisp)  2.6.8 CLtL1    May 16 2007 13:43:22
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/

>(setq a (make-list 100000) b (make-list 100000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.660 secs
run-gbc time    :      0.660 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.660 secs
run-gbc time    :      0.650 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.660 secs
run-gbc time    :      0.660 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(setq a (make-list 100000) b (make-list 100000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.650 secs
run-gbc time    :      0.660 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.650 secs
run-gbc time    :      0.650 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.650 secs
run-gbc time    :      0.660 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.650 secs
run-gbc time    :      0.660 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>
address@hidden:/nfs/i19/t1/camm/debian/gcl/nqt$ 
address@hidden:/nfs/i19/t1/camm/debian/gcl/nqt$ ./s7
GCL (GNU Common Lisp)  2.7.0 CLtL1    Jun 19 2007 17:08:06
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.

Temporary directory for compiler files set to /tmp/

>(setq a (make-list 100000) b (make-list 100000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.340 secs
run-gbc time    :      0.340 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.340 secs
run-gbc time    :      0.340 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.330 secs
run-gbc time    :      0.330 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.330 secs
run-gbc time    :      0.340 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(setq a (make-list 100000) b (make-list 100000) c nil)

NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.340 secs
run-gbc time    :      0.340 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.330 secs
run-gbc time    :      0.330 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.330 secs
run-gbc time    :      0.340 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

>(time (dotimes (i 1000) (equal a b)))

real time       :      0.330 secs
run-gbc time    :      0.330 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
NIL

=============================================================================

In any case, I think these results somehow vindicate the notion that
type checking can almost be had for free on modern machines.

nqthm 2.6.8 regression:

real    17m33.179s
user    16m51.135s
sys     0m6.168s

nqthm 2.7.0 regression:

real    15m53.573s
user    14m53.688s
sys     0m20.785s

I still have the problem of the multiple autocompiles, which bloats
the final image and leaves the contiguous memory region fragmented
like a piece of swiss cheese.

Take care,

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah






reply via email to

[Prev in Thread] Current Thread [Next in Thread]