1.1 --- a/tests/begat.py Mon Jan 24 16:37:46 2005 +0000
1.2 +++ b/tests/begat.py Mon Jan 24 16:38:55 2005 +0000
1.3 @@ -1,5 +1,11 @@
1.4 #!/usr/bin/env python
1.5
1.6 +"""
1.7 +The controversial "begat" benchmark. This module must be compiled using
1.8 +libxml2macro.py before use, and must then be invoked directly as a compiled
1.9 +module - ie. as begat.pyc.
1.10 +"""
1.11 +
1.12 import libxml2macro as n_
1.13 import time, os
1.14
1.15 @@ -12,10 +18,13 @@
1.16 text = n_node.nodeValue
1.17 l.append(text)
1.18
1.19 -#for n_node in n_doc.xpath("//v"):
1.20 -# text = n_node.nodeValue
1.21 -# if text.find(u'begat') != -1:
1.22 -# print text
1.23 +# NOTE: Code corresponding to this was suggested for cElementTree, but why not
1.24 +# NOTE: take full advantage of XPath if you have most of the code written in C?
1.25 +#
1.26 +# for n_node in n_doc.xpath("//v"):
1.27 +# text = n_node.nodeValue
1.28 +# if text.find(u'begat') != -1:
1.29 +# print text
1.30
1.31 print "Time taken", time.time() - t
1.32 raw_input("Stop your engines!")