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

Re: Number crunching in CLISP.



>>>>> "RLS" == RLS  <RLS@waikato.ac.nz> writes:

RLS> I've heard that Marcus is investigating GNU IUL for unboxing
RLS> double-float arrays for the FFI (foreign function interface),
RLS> does this mean that we might get unboxed double-float arrays in
RLS> CLISP, i.e. faster math?

Parc's ILU isn't going to help with boxing overhead for double-arrays.
Since the goal with unboxed double arrays is to avoid copying and
reformatting between LISP and foreign code, there is the assumption
that a shared format is used (e.g. IEEE).  That currently isn't the case.

Much of the cost in these types of loop is byte-interpreter overhead,
not the actual arithmetic.

The Alpha AXP, with unboxed single floats, may give you an idea of
boxing costs.

(defun test-integer (cnt)
  (let ((sum 0))
    (dotimes (x cnt) (incf sum 2))))

(defun test-float (cnt)
  (let ((sum 0.0))
    (dotimes (x cnt) (incf sum 2.0))))

(defun test-double (cnt)
  (let ((sum 0.0d0))
    (dotimes (x cnt) (incf sum 2.0d0))))

(compile 'test-integer)
(compile 'test-float)
(compile 'test-double)
(time (test-integer 1000000))
(time (test-float 1000000))
(time (test-double 1000000))

Alpha AXP:
(integer)
Real time: 16.448345 sec.
Run time: 7.51032 sec.
Space: 0 Bytes
(float)
Real time: 22.088549 sec.
Run time: 8.887456 sec.
Space: 0 Bytes
(double)
Real time: 49.657707 sec.
Run time: 19.948463 sec.
Space: 15999984 Bytes
GC: 27, GC time: 3.202256 sec.