A slightly surprising and good thing

"Tim Bradshaw (as tfb at tfeb dot org)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Writing my struct-of-arrays thing has been a horrible experience.  It got overcomplicated and I just got lost several times.  But it is gradually making some sense.

One of the things that matters is to have speed tests, because the whole point is to be able to write code which looks like it's not array bashing but is, and where almost all the declarations are inserted by the binding constructs.  If it's not close to code with lots of explicit arefs and double-float declarations it's just no use at all.  Such things also help me work out if the syntax is reasonable and check that it does find things it should (classes being redefined incompatibly after the macro has made its assumptions about them for instance).

So I have some rudimentary tests which really just sum elements from big (dressed-up) double-float arrays.

SBCL (compiling with speed 3 safety 0) takes about 9.85E-10s for an array read and sum into a variable, and an integer increment & test.  So roughly 3 cycles for my machine

LW (compiling with speed 3 safety 0 float 0) takes about 9.86E-10s for the same thing.

Obviously the last digit is meaningless here.  What was pleasing is that for this case LW is not slower than SBCL at all.  It does much less well if safety is not 0 whereas SBCL obviously manages to convince itself of enough things that it can elide checks anyway.

(And there's no difference using explicit arrays).

So that's quite nice: LW is a lot quicker than I expected it to be!

--tim

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.