This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Documentation proposal


Michael Livshin <mlivshin@bigfoot.com> writes:

 > "Harvey J. Stein" <hjstein@bfr.co.il> writes:
 > 
 > > I'd probably do it if I felt there was general interest, but I don't
 > > think there is...
 > 
 > you mean we are happy to have a Perl script extract Guile's core docs?

I'm not happy about it, but it's not up to me...

 > sacrilege!

Absolutely.

 > is the speed difference *that* bad?

I was fortunately able to find an old msg in the guile mailing list
archive talking about it:


   The cheap answer is that my heavily optimized extract.scm is still >
   5x slower than the perl version & is spending the bulk of its time in
   regexp crap.  I had to throw out regexp-substitute/global because it
   was too slow to get this close.  Not to mention that straight regexp
   stuff is 5x slower in guile than in perl, & >10x slower than in awk.

I think the scheme version was ~10x slower before hand hacking.  It
might be a little bit faster now because read-line's line counting
isn't broken any more.  I had to do:

   ;;; Fix for guiles with broken line counting on read-line:
   (define (counting-read-line p)
     (set-port-line! p (1+ (port-line p)))
     (car (%read-line p)))			; %read-line is substantially faster than read-line!

because of the broken counting.  (Also note the ugly %read-line call
for efficiency's sake.

BTW, now I add:

;;; Maybe we don't need the above...
(call-with-input-string "a\nb"
			(lambda (p)
			  (read-line p)
			  (read-line p)
			  (if (> (port-line p) 0)
			      (set! counting-read-line (lambda (p)
							 (car (%read-line p)))))))

at the top to throw the previous defun away if the it's unneeded.

Also, I think my timings were wrt running extract on all the scwm
source code files.  Doing it just on one file was much worse because
of the slow startup issues.  This made, for example, adding make
dependencies to do doc extraction substantially more expensive than
the above indicates.

BTW - profiling support in guile would help alot.  I had to port my
profiling wrapper code from STk to guile, which is a sub-optimal
solution.  AFAIK, guile never adopted my wrappers, and never added an
alternative.

-- 
Harvey Stein
Bloomberg LP
hjstein@bfr.co.il

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]