axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] notangle


From: C Y
Subject: [Axiom-developer] notangle
Date: Sun, 18 Feb 2007 14:01:53 -0800 (PST)

(changing the subject since it's no longer true ;-)

--- Waldek Hebisch <address@hidden> wrote:

> Below is a newer version of CL notangle, this time handling recursive
> references.  There are still significant differences compared to
> real notangle (lack of @ escapes, different end of line handling,
> ...).

Well, we probably don't actually need the full power of noweb notangle
- I think it makes more sense to enforce sane pamphlet writing style
instead (improves human readability, for that matter - stays
consistent).

By lack of @ escapes, do you mean that any @ in the file is treated as
the end of a code chunk, e.g. no awareness of position?  (e.g. it won't
be able to process itself as a pamphlet?)  From what I saw earlier the
only two things that are really needed are recognizing an illegal chunk
name due to newline inclusion (you may not even need that one the way
you've defined your start and end chars) and making sure @ is right
after a newline (at least for parsing Axiom files, which is the main
goal.)  I'll have a go at it later and see how it behaves.

> I also fixed performace problem in scan-for-chunks (previous version
> was using 'equal' and sbcl emited actual call to 'equal', current
> version uses 'eql' which generates inline code).  Another performance
> problem was using arrays of bytes as hash keys (completly killed
> performance for pamphlets with many small chunks, or chunks
> split into many small pieces).  I solved this problem converting
> arrays to strings before hashing.

Wow.  VERY impressive work.  One question Waldek - I'm willing to try
to convert this code into a literate document for purposes of Axiom
inclusion, but I fear I'm not competent to describe these issues and
reasons for specific choices.  I'll take a stab at it using your emails
as a starting point (indeed, that might be a good way to ensure the
documentation covers enough for other clueless beginners) but are you
up for a few painfully ignorant questions? ;-)

Also, are you OK with the modified BSD license for this?  It's
essentially all your code at this point so I don't want to presume.

> This version seem to be significantly faster than notangle: it is
> able to process simple 8 Mb file (containing few big chunks) in 0.14s
> while notangle needs 2s.  On 8Mb file containing 1000 chunks, each
> consisting of 100 pieces 10 lines each, my version needs 0.24s, while
> notangle uses 2.85s. 

You may have just become the poster child for those trying to debunk
the "lisp is slow" myth ;-).

> BTW. Timing was done on 2GHz Athlon 64.  Notangle came from Axiom
> build, Lisp is sbcl 1.0.  I tried also clisp, but it is quite slow
> (need 8.73 senconds on my second test file) -- no wonder since I use
> a low level code.  This version (like the previous one) does not
> work with gcl (ANSI 2.6.5 interpreter claims that 'read-sequence'
> is undefined, non-ANSI interpreter chokes on 'defclass').

Um.  Clisp doesn't surprise me, and normally if speed is a concern
people don't run on Clisp anyway.  I also ran into the defclass thing
on GCL - perhaps we could use defstruct instead?  I don't know that
there's any particular reason to use CLOS other than convenience and
trying to be "modern".

Cheers, and thanks again for some really excellent work!

CY



 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]