-------------------------------------------------------------- SLOT-SETTING TEST on CMU Common Lisp release x86-linux 3.0.8 18c+ 31 December 2001 build 3030 Setting via an accessor [1000000 accesses]: Evaluation took: 0.19 seconds of real time 0.19 seconds of user run time 0.0 seconds of system run time 1 page fault and 0 bytes consed. Setting via SLOT-VALUE [1000000 accesses]: Evaluation took: 1.37 seconds of real time 1.31 seconds of user run time 0.03 seconds of system run time 0 page faults and 0 bytes consed. Setting in EQ-table [1000000 accesses](10000 objs already in table): Evaluation took: 0.92 seconds of real time 0.75 seconds of user run time 0.03 seconds of system run time 0 page faults and 0 bytes consed. Setting in EQL-table [1000000 accesses](10000 objs already in table): Evaluation took: 1.38 seconds of real time 1.0 seconds of user run time 0.06 seconds of system run time 0 page faults and 0 bytes consed. Setting in EQUAL-table [1000000 accesses](10000 objs already in table): Evaluation took: 2.09 seconds of real time 2.01 seconds of user run time 0.04 seconds of system run time 0 page faults and 0 bytes consed. --------------------------------------------------------------
Odd Benchmarks
A simple benchmark where one tries to set a value in a CLOS-object and in a hash-table, compares how much time this takes. The source may be found at http://www.ii.uib.no/~stig/set-speed-lisp.tar
(The benchmark was done because I was uncertain of whether to use slots or a hash-table for an application).