More info loading fun



>>>>> "Rupert" == Rupert Swarbrick <rswarbrick at gmail.com> writes:

    Rupert> Raymond Toy <toy.raymond at gmail.com> writes:
    >> I tried this out on an old 750 MHz sparc with cmucl, the oldest and
    >> slowest machine I have access to.  From the maxima prompt until "?
    >> run_testsuite" returns, it takes about 7 sec.  A tad slow, but not
    >> terribly slow.  About 3 sec for the next invocation.
    >> 
    >> For completeness, here are the results from the commit message:
    >> 
    >> ; Evaluation took:
    >> ;   5.56f0 seconds of real time
    >> ;   5.2f0 seconds of user run time
    >> ;   0.27f0 seconds of system run time
    >> ;   4,173,048,959 CPU cycles
    >> ;   0 page faults and
    >> ;   21,354,312 bytes consed.

    Rupert> Thank you very much for trying this out! To be honest, that's quite a
    Rupert> lot slower than I was expecting. I spent some time trying to see whether
    Rupert> we could be faster on CMUCL and it looks like there's something weird
    Rupert> buried in the regex engine. More below.

I will do some more testing on this slow machine, but I wouldn't worry
too much about how slow it is.  Who is running maxima on such a slow
machine now?

    >> Works ok with cmucl on a Mac.  (But the 2013-03a snapshot has a bug in
    >> file-position that causes the text to be wrong.)

    Rupert> Oh dear. Is that something we can / should work around? What propertion
    Rupert> of cmucl users will be running the 2013-03a snapshot?

Well, I think, as a hack, just subtract 512 from the result of
file-position.  But the proportion of users running 2013-03a is
probably close enough to zero that it doesn't matter.  2013-04 will
have this fixed.

    Rupert> About the regex stuff:

    Rupert> TLDR:
    Rupert> =====

    Rupert> (1) I've just pushed a change that makes "??" significantly faster on
    Rupert> CMUCL and should improve it on other lisps too. No change to "?",
    Rupert> I'm afraid.

One thing I did notice while glancing at the code:

(defun strip-section-title (title)
  (string-downcase
   (coerce (delete-if (lambda (char) (member char '(#\, #\. #\Space)))
                      (coerce title 'list))
           'string)))

This is probably better written as

  (string-downcase (remove-if (lambda (char) (member char '(#\, #\. #\Space)))
                              title))

No need to explode the title string into a list.

    Rupert> (2) Ray, is there any way you can easily work out what the sparc is
    Rupert> spending all it's time on? (with the new code) Running the first
    Rupert> code snippet below with profile:profile-all would probably tell me
    Rupert> a lot. If you can, could you use (topic-match "foo" t) and
    Rupert> (topic-match "foo" nil) and let me know the difference?

Only had to build and run the one quick test.  I'll look more later
this week.

[snip]

    Rupert> !!! Looks like I've found something CMUCL is doing really badly

Hmm.  Cmucl used to be pretty fast with nregex, at least way back when
nregex as added to cmucl.

    Rupert> I'm not going to work on MAXIMA-NREGEX today. Indeed, maybe the right
    Rupert> thing to do is to replace it with CL-PPCRE or similar? Anyway, the good

cl-ppcre is not an option since it doesn't run with gcl.

I'll dig a bit more into this later.

Ray