od_20000608.html revision 5f90462bbf4efb0ac7bb65a852d5559d0ab30f0b
1<!-- 
24XPath Performance test from "Olivier Deckmyn" <odeckmyn.list@teaser.fr>, with import and filename updates
3
4Subject: [4suite] 4XPath performance ?
5Date: Thu, 8 Jun 2000 16:30:21 +0200
6From: "Olivier Deckmyn" <odeckmyn.list@teaser.fr>
7To: "4Suite list" <4suite@dollar.fourthought.com>
8
9I am playing and testing 4XPath....
10And I am a little afraid of the results I see...
11The machine is a Dell Server (2400) with a single PIII-750 and 256MB RAM,
12USCSI disks (10K RPM), running FreeBSD4.
13
14There is a lot of memory, cpu is not used for anything else than the test...
15
16With a 100KB xml file, I have applied the attached test1.py
17
18Here are the results :
19QUERY="//author" (no match in the file)
20Reading document
21took 1.336457 sec
22Starting query
23took 307.572385 sec
24Indexing DOM
25took 0.125362 sec
26Starting query
27took 84.692544 sec
28
29QUERY="//date" (few matches in the file)
30Reading document
31took 1.341848 sec
32Starting query
33took 308.466919 sec
34<date> 10 October 1996</date><date>1 August 1996</date><date>17 April
351996</date><date> 17 April 1996</date><date> 17 April 1996</date><date> 12
36April 1996</date><date>27 March 1996</date><date>27 March
371996</date><date>23 February 1996</date><date>9 December 1996</date><date>
3829 November 1996</date><date> 31 October 1996</date>Indexing DOM
39took 0.128668 sec
40Starting query
41took 85.145023 sec
42<date> 10 October 1996</date><date>1 August 1996</date><date>17 April
431996</date><date> 17 April 1996</date><date> 17 April 1996</date><date> 12
44April 1996</date><date>27 March 1996</date><date>27 March
451996</date><date>23 February 1996</date><date>9 December 1996</date><date>
4629 November 1996</date><date> 31 October 1996</date>
47
48
49Result :
50Indexing is worth the price ! Very quick index build, and 3.5x speed gain
51...
52But, it very slow anyway :(
53
54Is this the "normal" performance ? Can I do better?
55-->
56<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
57<html>
58<head>
59<link rel="stylesheet" href="/js/resources/js-test-style.css">
60<script src="/js/resources/js-test-pre.js"></script>
61</head>
62<body>
63<div id="console"></div>
64
65<script>
66
67    req = new XMLHttpRequest;
68    req.open("GET", 'resources/od_20000608.xml', false);
69    req.send(null);
70    xml_dom_object = req.responseXML;
71
72    EXPR = '//author'
73    nodeset = xml_dom_object.evaluate(EXPR, xml_dom_object, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
74    shouldBe('nodeset.snapshotLength', '0')
75
76    EXPR = '//date'
77    nodeset = xml_dom_object.evaluate(EXPR, xml_dom_object, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
78    shouldBe('nodeset.snapshotLength', '12')
79
80    var successfullyParsed = true;
81
82</script>
83<script src="/js/resources/js-test-post.js"></script>
84</body>
85</html>
86