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

Re: Where reading files into ZWEI spends its time.



The time spent inside the LINE-IN operation of the file stream, about half
of the total, breaks down roughly as follows:
	1/3 in STRING-SEARCH-CHAR looking for a carriage return
	1/3 in FILE-NEXT-READ-PKT, of which
	    almost 1/2 CHAOS:GET-NEXT-PKT
	    almost 1/2 TV-WHO-LINE-UPDATE
		(This is somewhat inflated since there were who-line
		 updates due to my typing the commands to read the file.)
	1/3 elsewhere (generally just executing code.)
	1/10 of the total is in ADJUST-ARRAY-SIZE, which is a fairly
		slowly-written function.

I changed it to open-code the STRING-SEARCH-CHAR, not calling CHAR-EQUAL
since it's using 8-bit characters and not searching for a letter.  It's hard
to measure the difference but I think it cut out only about 1/2 of the time
that was spent searching for the CR.  I haven't tried to do anything about
the who-line update yet.

This code (in QFILE) could probably use a bit more attention.

The 1/6 of the time spent in the Chaos net is probably reasonable.

To help with these measurements I'm writing a little (teensy) timing
package.  It will be in AI:MOON;LMTIME (it isn't done yet, and I don't
guarantee to leave it in working condition.)
---
RMS@MIT-AI 07/20/79 01:11:04 Re: Where reading files into ZWEI spends its time.
To: (BUG ZWEI) at MIT-AI
These statistics apply to reading in LMIO;CHSNCP.
The largest share is spent inside the chaos stream: 27 seconds.
The next largest goes to sectionizing.  It takes about 20 seconds
but this time increases with the amount of data in the editor.
Doing the interns takes 6 seconds, but swaps in enough to delay
other things another 4 seconds or so.  Merging the arrays adds another 10.
Removing the old definitions for this buffer takes another 2 or so.

The ZWEI interval-stream takes only about 2 seconds to store the lines.
It takes about 4 seconds to open the file, maybe 2 to close it.

Grand total: about 1 minute.