Re: xmls 0.2 released
Sven Van Caekenberghe <[email protected]>
| Newsgroups | gmane.lisp.clump |
|---|---|
| Message-ID | <[email protected]> |
On Thursday, June 12, 2003, at 09:36 PM, Miles Egan wrote:
> The big speed win was figuring out a way to handle cdata sections
> without more than one character of lookahead. Getting rid of the
> userspace lookahead buffer and going back to read-char / unread-char
> accounts for almost all of the speedup. It's now roughly as fast as
> your library in my tests.
This is how they compare on my test files (PowerBook G4/677, OpenMCL
0.13.5):
? (time (with-open-file (in #p"home:cvs;svc;xml;test;plist.xml"
:direction :input)
(xmls:parse in)
t))
(WITH-OPEN-FILE (IN #4P"home:cvs;svc;xml;test;plist.xml" :DIRECTION
:INPUT) (XMLS:PARSE IN) T) took 9 milliseconds (0.009 seconds) to run.
Of that, 10 milliseconds (0.010 seconds) were spent in user mode
0 milliseconds (0.000 seconds) were spent in system mode
13,424 bytes of memory allocated.
T
? (time (with-open-file (in #p"home:cvs;svc;xml;test;plist.xml"
:direction :input)
(xml:parse-xml in :output-type :lxml)
t))
(WITH-OPEN-FILE (IN #4P"home:cvs;svc;xml;test;plist.xml" :DIRECTION
:INPUT) (XML:PARSE-XML IN :OUTPUT-TYPE :LXML) T) took 7 milliseconds
(0.007 seconds) to run.
Of that, 0 milliseconds (0.000 seconds) were spent in user mode
0 milliseconds (0.000 seconds) were spent in system mode
7 milliseconds (0.007 seconds) were spent executing other OS
processes.
3,552 bytes of memory allocated.
T
? (time (with-open-file (in
#p"home:cvs;svc;xml;test;ant-build-file.xml" :direction :input)
(xmls:parse in)
t))
(WITH-OPEN-FILE (IN #4P"home:cvs;svc;xml;test;ant-build-file.xml"
:DIRECTION :INPUT) (XMLS:PARSE IN) T) took 46 milliseconds (0.046
seconds) to run.
Of that, 40 milliseconds (0.040 seconds) were spent in user mode
0 milliseconds (0.000 seconds) were spent in system mode
6 milliseconds (0.006 seconds) were spent executing other OS
processes.
172,384 bytes of memory allocated.
T
? (time (with-open-file (in
#p"home:cvs;svc;xml;test;ant-build-file.xml" :direction :input)
(xml:parse-xml in :output-type :lxml)
t))
(WITH-OPEN-FILE (IN #4P"home:cvs;svc;xml;test;ant-build-file.xml"
:DIRECTION :INPUT) (XML:PARSE-XML IN :OUTPUT-TYPE :LXML) T) took 35
milliseconds (0.035 seconds) to run.
Of that, 20 milliseconds (0.020 seconds) were spent in user mode
0 milliseconds (0.000 seconds) were spent in system mode
15 milliseconds (0.015 seconds) were spent executing other OS
processes.
19,968 bytes of memory allocated.
T
? (time (with-open-file (in #p"home:cvs;svc;xml;test;xhtml-page.xml"
:direction :input)
(xmls:parse in)
t))
(WITH-OPEN-FILE (IN #4P"home:cvs;svc;xml;test;xhtml-page.xml"
:DIRECTION :INPUT) (XMLS:PARSE IN) T) took 69 milliseconds (0.069
seconds) to run.
Of that, 60 milliseconds (0.060 seconds) were spent in user mode
0 milliseconds (0.000 seconds) were spent in system mode
9 milliseconds (0.009 seconds) were spent executing other OS
processes.
263,760 bytes of memory allocated.
T
? (time (with-open-file (in #p"home:cvs;svc;xml;test;xhtml-page.xml"
:direction :input)
(xml:parse-xml in :output-type :lxml)
t))
(WITH-OPEN-FILE (IN #4P"home:cvs;svc;xml;test;xhtml-page.xml"
:DIRECTION :INPUT) (XML:PARSE-XML IN :OUTPUT-TYPE :LXML) T) took 53
milliseconds (0.053 seconds) to run.
Of that, 50 milliseconds (0.050 seconds) were spent in user mode
0 milliseconds (0.000 seconds) were spent in system mode
3 milliseconds (0.003 seconds) were spent executing other OS
processes.
35,744 bytes of memory allocated.
T
The test files are a bit too small for decent speed tests. I think it
is indeed safe to say that they are in the same league (mine doesn't do
namespaces though, but there are none used in the test files).
You do however cons a lot more - if you could find the big offenders
there, you'll gain speed as well.
Sven