/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/cxml-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 :cxml)
 
7
 
 
8
(defvar dom NIL)
 
9
 
 
10
(defun parse_file (fn)
 
11
    (setf dom
 
12
        (cxml:parse-file fn (cxml-xmls:make-xmls-builder))))
 
13
 
 
14
(defun parse_iteration (fn i)
 
15
    (if fn
 
16
        (parse_file fn)
 
17
        (parse_file (concatenate 'string "../xml.tmp/" (write-to-string i) ".xml"))))
 
18
 
 
19
 
 
20
(defvar iterations NIL)
 
21
(defvar xmlfn NIL)
 
22
 
 
23
(if (> (length *ARGS*) 0)
 
24
    (setf iterations (parse-integer (first *ARGS*)))
 
25
    (setf iterations 0))
 
26
 
 
27
(if (> (length *ARGS*) 1)
 
28
    (setf xmlfn (second *ARGS*))
 
29
    (setf xmlfn NIL))
 
30
 
 
31
(parse_iteration xmlfn 0)
 
32
;(pprint (list "Number of Iterations" iterations))
 
33
(if (> iterations 0)
 
34
    (time
 
35
        (dotimes (i iterations) 
 
36
            (parse_iteration xmlfn (+ i 1))))
 
37
    (dotimes (i iterations) 
 
38
        (parse_iteration xmlfn (+ i 1))))
 
39
 
 
40
 
 
41
;(pprint dom)