Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

SBCL is retarded

Name: Anonymous 2012-07-03 22:57

Why

    (while (/= i e)
      #.`(progn ,@(loop as i below 16 append '((setf (aref d i) color) (incf i)))))
    (format nil "")
    (dotimes (j (- l e)) (setf (aref d (f+ i j)) color))

runs at 545,960 processor cycles (according to TIME), but

    (while (/= i e)
      #.`(progn ,@(loop as i below 16 append '((setf (aref d i) color) (incf i)))))
    (dotimes (j (- l e)) (setf (aref d (f+ i j)) color))

takes 2,221,300 processor cycles? does SBCL rolls the loop back or what? why inserting noise statements increases drawing speed?

Name: Anonymous 2012-07-03 22:59

>>1
Yes. And there is no mistake: I can see with my eyes the jump sprite movement with addition of useless (format nil "").

Name: Anonymous 2012-07-03 23:07

https://bugs.launchpad.net/sbcl/+bug/554190

SBCL does not do any classic loop optimizations (e.g. unrolling), let alone any of the higher-level transforms described in Allen and Kennedy. SBCL does rudimentary loop analysis to aid register allocation and aligning loop heads -- but that's it. In this case it's particularly sad as the (= 1 1) is optimized away -- so the loop is quite breathtaking:

; B0: L0: 4883C108 ADD RCX, 8
; B4: L1: 483B0D25000000 CMP RCX, [RIP+37]
; BB: 7EF3 JLE L0

Name: Anonymous 2012-07-03 23:27

UNOPTIMIZING OPTIMIZING COMPILERS

Name: Anonymous 2012-07-03 23:34

(libc::memset_pattern4 (sb-sys:vector-sap d) (sb-sys:vector-sap v) (* l 4))
Does the same in about 323,096 processor cycles. Had SBCL done basic optimizations, its speed would have been comparable to GCC.

Name: bampu pantsu 2012-07-06 4:54

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List