[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Slow I/O part II
- Subject: Slow I/O part II
- From: zaker@lslsun2.epfl.ch (Sassan Zaker)
- Date: 8 Jul 1993 20:23:22 GMT
You made a couple of suggestions to my original posting.
I'll be testing them. Meanwhile here is a more quantified example.
Notice I'm doing some small parsing as I read along in the file. I'll make a test without, this with little faith though.
This is the actual code with the resulting timing run-down from (time ...)
This run on a MacIIcx with 5Mb allocated to MCL
The file in the example is a spice-file (ascii) of 379 lines and 14997 chars.
There You have it all ... Thanx
;*********TIMING COST********************
(MAKE-MASTERLIST "codes-sz:optimoser-clos:spice-netlists:adder.2bit.ss") took 15492 milliseconds (15.492 seconds) to run.
Of that, 449 milliseconds (0.449 seconds) were spent in The Cooperative Multitasking Experience.
182792 bytes of memory allocated.
;*******************************************
(DEFUN Make-MasterList (iFileName )
"Reads the iFileName and creates a list of all useful lines "
(LET (
(Master-list '())
(NLdel "") ;each new line with deleted unwanted characters
)
(WITH-OPEN-FILE
(IFile IFileName)
(Do
((NL (READ-LINE iFile Nil iFile) (READ-LINE iFile Nil iFile))
(i 0 (1+ i)) )
((EQ NL iFile) "Msg: End of File" ) ; Do end condition
(WHEN (NOT (STRING-EQUAL NL "")) ;skip empty lines
(IF (is-comment-line? NL) ;eliminate chars that trouble Read-From-String like vertical-bar
(SETQ NLdel (Delete-unwed-chars NL)) ;eliminate the unwanted chars that usually only happen in comment lines
(SETQ NLdel NL)) ;can't do this to all lines. eg. points in non-comment lines could be like in 0.756
(IF (IS-USEFUL-LINE? NLdel)
(PUSH NLdel Master-list)) ) )) ;; a list of non-comment lines
(NREVERSE Master-list)
))