/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to parse/lisp/sxml-xmls.cl

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-28 21:25:28 UTC
  • Revision ID: csa@dside.dyndns.org-20090928212528-e6oby5he4yrueskz
Parsing tests for mono, vtd-xml, lisp, scripting languages

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/clisp -C -q -q
 
2
; Should be called from root account once to generate binaries for libraries
 
3
 
 
4
(load #p"/usr/share/common-lisp/source/asdf/asdf.lisp")
 
5
(push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
 
6
(asdf:oos 'asdf:load-op :s-xml)
 
7
 
 
8
;(in-package :s-xml)
 
9
 
 
10
(defvar dom NIL)
 
11
 
 
12
(defun parse_xml (xml)
 
13
  (s-xml::parse-xml xml :output-type :sxml))
 
14
 
 
15
(defun parse_file (fn)
 
16
    (setf dom
 
17
        (with-open-file 
 
18
            (xml fn) 
 
19
            (parse_xml xml))))
 
20
 
 
21
(defun parse_iteration (fn i)
 
22
    (if fn
 
23
        (parse_file fn)
 
24
        (parse_file (concatenate 'string "../xml.tmp/" (write-to-string i) ".xml"))))
 
25
 
 
26
 
 
27
(defvar iterations NIL)
 
28
(defvar xmlfn NIL)
 
29
 
 
30
(if (> (length *ARGS*) 0)
 
31
    (setf iterations (parse-integer (first *ARGS*)))
 
32
    (setf iterations 0))
 
33
 
 
34
(if (> (length *ARGS*) 1)
 
35
    (setf xmlfn (second *ARGS*))
 
36
    (setf xmlfn NIL))
 
37
 
 
38
(parse_iteration xmlfn 0)
 
39
;(pprint (list "Number of Iterations" iterations))
 
40
(if (> iterations 0)
 
41
    (time
 
42
        (dotimes (i iterations) 
 
43
            (parse_iteration xmlfn (+ i 1))))
 
44
    (dotimes (i iterations) 
 
45
        (parse_iteration xmlfn (+ i 1))))
 
46
 
 
47
 
 
48
;(pprint dom)
 
49