[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-devel
Subject:    [Sbcl-devel] More optimization for transitive functions.
From:       Heka Treep <zena.treep () gmail ! com>
Date:       2010-05-04 21:50:15
Message-ID: u2v62d780331005041450t5fb423ecv4eb4b4ee73ef56c8 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

This is about one little optimization in src/compiler/srctran.lisp. The
problem is follow:

(disassemble (lambda (a b c) (+ a 1 b 2 c 3)))
;; call to GENERIC-+ 5 times

(disassemble (lambda (a b c) (+ 1 2 3 a b c)))
;; call to GENERIC-+ 3 times

Looks like we need to collect self-evaluated atoms and evaluate them in
compile time.

I stumbled on this when I had to solve a large SLAE with parameters - the
answer was a long list of variables and numbers, and I haves so much calls
to arithmetic functions.

So, I attached patch, but I'm not sure that it already clean :) However, on
my problem the number of calls to GENERIC-FOO is reduced by half.

[Attachment #5 (text/html)]

Hi,<br><br>This is about one little optimization in src/compiler/srctran.li=
sp. The problem is follow:<br><br>(disassemble (lambda (a b c) (+ a 1 b 2 c=
 3)))<br>  ;; call to GENERIC-+ 5 times<br><br>(disassemble (lambda (a b c)=
 (+ 1 2 3 a b c)))<br>
  ;; call to GENERIC-+ 3 times<br><br>Looks like we need to collect self-ev=
aluated atoms and evaluate them in compile time.<br><br>I stumbled on this =
when I had to solve a large SLAE with parameters - the answer was a long li=
st of variables and numbers, and I haves so much calls to arithmetic functi=
ons.<br>
<br>So, I attached patch, but I&#39;m not sure that it already clean :) How=
ever, on my problem the number of calls to GENERIC-FOO is reduced by half.<=
br><br>

--0016e6497dfce017d00485cbb191--
["diff" (application/octet-stream)]

------------------------------------------------------------------------------


_______________________________________________
Sbcl-devel mailing list
Sbcl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic