This is the mail archive of the guile@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: Startup time in guile-1.3 (II)


I've now committed the following change to the repository:

1998-11-06  Mikael Djurfeldt  <mdj@barbara.nada.kth.se>

	* ports.h (SCM_CUC): #define as ~SCM_CRDY instead of 0x001fffffL.
	This is quite important since the latter clears the
	FPORT_READ_SAFE and FPORT_WRITE_SAFE flags causing flushes at
	every single character read...

Mikael Djurfeldt <mdj@nada.kth.se> writes:

> OK, found it:
> 
> 1998-10-09  Jim Blandy  <jimb@zwingli.cygnus.com>
> 
> 	Do magic to mix reads and writes on stdio FILE-based ports.
> 	(Thanks to Christian Lynbech.)
>
> [...]
> 
> The former gives a startup speed of 4.68 on my Ultra.
> The latter gives 0.86 s.

I had planned to take the mix read/write code out of Guile because a
slowdown of loading of more than 4 times is unacceptable.  I had
edited the code, written a NEWS entry explaining the workaround people
should use when this code was removed and prepared a letter to send to
the guile list.  But then I got this feeling that something wasn't
alright.  I had noted earlier that the definition of SCM_CUC cleared
the SAFE-flags, so I realized that the code didn't just slow down
loading by 300 percent---it was also non-functional, I thought.  Just
before committing, I got this feeling and had a closer look.  I
discovered that the 300 percent slowdown was due to flushes being made
at EVERY SINGLE character being read...!

The startup speed is now 0.88 s which is a slowdown of 2 percent...

I'll let the mix read/write code be while we wait for Gary's code.

> I actually got angry when I saw this change.  It's completely insane
> to do that much work for every character being read in the innermost
> loop of the reader.
> 
> Doesn't people have any feeling for what is time critical and what is
> not?

I guess the conclusion I have to draw from this is that *I* don't have
a good feeling for what is time critical and what is not.  I should
have suspected that there was something more going on here.
Sigh...

Sorry for all the fuzz.  :(

/mdj