Quick Arrays
A re-run benchmark on original code by Ron Parr, with a couple of tweaks by David Mullen to run on CCL, figuring that the contrast between then and now (1996 versus 2020) might be interesting. The test involves arrays with double-float elements.

README (1996) with links

Welcome to Version 1.1 of Ron's Quick Arrays!

The Quick Arrays package is a quick and dirty replacement for the standard array data structure in Common Lisp. Like a lot of things in Common Lisp, arrays have lots of fancy, often-unused features that reduce performance considerably in many implementations especially MCL 3.9. While it is possible to achieve better performance in some cases through typed arrays in some lisps, Quick Arrays, provides a performance boost without hurting the readability or compactness of your code and is much faster than any other approach for arrays of mixed type and it is faster than typed arrays in MCL 3.9. See the included document, Coding Tips, for specific suggestions on writing fast lisp code using arrays.

Quick Arrays represents arrays as vectors of vectors. This often permits much faster array references at the expense of some flexibility. Quick Arrays are not adjustable and many of the functions that work with standard arrays have not been implemented for Quick Arrays.

The Quick Arrays package comes in two parts, quick-arrays.cl and qtest.cl. The first contains the functions and macros that implement quick arrays. The second file, qtest.cl, contains a simple test program to tell if Quick Arrays is faster in your environment than standard arrays.

Read the header of each file for more information.

Thanks for trying Ron's Quick Arrays!

MCL qtest (32-bit)

These results are from MCL 3.9 on a PowerBook 5300. MCL was running in a 20 MB partition with no virtual memory.

Running standard array implementation.
(MM A B C) took 25,211 milliseconds (25.211 seconds) to run.
Of that, 393 milliseconds (0.393 seconds) were spent in The Cooperative Multitasking Experience.
1,804 milliseconds (1.804 seconds) was spent in GC.
 32,000,016 bytes of memory allocated.


Running optimized standard array implementation.
(MMOPT A B CTEST) took 23,175 milliseconds (23.175 seconds) to run.
Of that, 1,969 milliseconds (1.969 seconds) were spent in The Cooperative Multitasking Experience.
1,786 milliseconds (1.786 seconds) was spent in GC.
 32,000,016 bytes of memory allocated.


Running optimized standard array implementation with typed arrays.
(MMOPT AT BT CT) took 27,042 milliseconds (27.042 seconds) to run.
Of that, 737 milliseconds (0.737 seconds) were spent in The Cooperative Multitasking Experience.
5,300 milliseconds (5.300 seconds) was spent in GC.
 80,000,048 bytes of memory allocated.

Verifying Consistency...Check!

Running quick arrays using qaref.
(QAMM QA QB QC) took 28,584 milliseconds (28.584 seconds) to run.
Of that, 385 milliseconds (0.385 seconds) were spent in The Cooperative Multitasking Experience.
7,111 milliseconds (7.111 seconds) was spent in GC.
 96,160,064 bytes of memory allocated.

Verifying Consistency...Check!

Running optimized quick arrays using qaref.
(QAMM-OPT QA QB QC) took 26,025 milliseconds (26.025 seconds) to run.
Of that, 361 milliseconds (0.361 seconds) were spent in The Cooperative Multitasking Experience.
6,228 milliseconds (6.228 seconds) was spent in GC.
 96,160,056 bytes of memory allocated.

Verifying Consistency...Check!

Running quick arrays using qref.
(QMM QA QB QC) took 13,831 milliseconds (13.831 seconds) to run.
Of that, 177 milliseconds (0.177 seconds) were spent in The Cooperative Multitasking Experience.
2,697 milliseconds (2.697 seconds) was spent in GC.
 32,000,024 bytes of memory allocated.

Verifying Consistency...Check!

Running optimized quick arrays using qref.
(QMMOPT QA QB QC) took 8,970 milliseconds (8.970 seconds) to run.
Of that, 103 milliseconds (0.103 seconds) were spent in The Cooperative Multitasking Experience.
1,811 milliseconds (1.811 seconds) was spent in GC.
 32,000,016 bytes of memory allocated.

Verifying Consistency...Check!

CCL qtest (64-bit)

These results are from CCL 1.11.5 on a Lenovo IdeaPad.

Running standard array implementation.
(MM A B C)
took 83,000 microseconds (0.083000 seconds) to run.
During that period, and with 4 available CPU cores,
     78,125 microseconds (0.078125 seconds) were spent in user mode
          0 microseconds (0.000000 seconds) were spent in system mode
 32,000,064 bytes of memory allocated.

Running optimized standard array implementation.
(MMOPT A B CTEST)
took 77,000 microseconds (0.077000 seconds) to run.
      2,041 microseconds (0.002041 seconds, 2.65%) of which was spent in GC.
During that period, and with 4 available CPU cores,
     62,500 microseconds (0.062500 seconds) were spent in user mode
          0 microseconds (0.000000 seconds) were spent in system mode
 32,000,064 bytes of memory allocated.


Running optimized standard array implementation with typed arrays.
(MMOPT-TYPE AT BT CT)
took 17,000 microseconds (0.017000 seconds) to run.
During that period, and with 4 available CPU cores,
     31,250 microseconds (0.031250 seconds) were spent in user mode
          0 microseconds (0.000000 seconds) were spent in system mode
 64 bytes of memory allocated.

Verifying Consistency...Check!

Running quick arrays using qaref.
(QAMM QA QB QC)
took 225,000 microseconds (0.225000 seconds) to run.
       2,161 microseconds (0.002161 seconds, 0.96%) of which was spent in GC.
During that period, and with 4 available CPU cores,
      62,500 microseconds (0.062500 seconds) were spent in user mode
      15,625 microseconds (0.015625 seconds) were spent in system mode
 160,000,064 bytes of memory allocated.

Verifying Consistency...Check!

Running optimized quick arrays using qaref.
(QAMM-OPT QA QB QC)
took 208,000 microseconds (0.208000 seconds) to run.
       1,192 microseconds (0.001192 seconds, 0.57%) of which was spent in GC.
During that period, and with 4 available CPU cores,
     125,000 microseconds (0.125000 seconds) were spent in user mode
           0 microseconds (0.000000 seconds) were spent in system mode
 144,000,064 bytes of memory allocated.

Verifying Consistency...Check!

Running quick arrays using qref.
(QMM QA QB QC)
took 77,000 microseconds (0.077000 seconds) to run.
During that period, and with 4 available CPU cores,
     62,500 microseconds (0.062500 seconds) were spent in user mode
          0 microseconds (0.000000 seconds) were spent in system mode
 32,000,064 bytes of memory allocated.

Verifying Consistency...Check!

Running optimized quick arrays using qref.
(QMMOPT QA QB QC)
took 46,000 microseconds (0.046000 seconds) to run.
During that period, and with 4 available CPU cores,
     31,250 microseconds (0.031250 seconds) were spent in user mode
     15,625 microseconds (0.015625 seconds) were spent in system mode
 16,000,064 bytes of memory allocated.

Verifying Consistency...Check!