Skip to content

Commit 0a56452

Browse files
committed
Examples: add times target
This creates a large (~8MB) XML document, reads it into the dom and writes a cannonical version. Timing this operation gives a reasonable overview of the performance of FoX.
1 parent 7ff99f6 commit 0a56452

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

examples/Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@ wcml_lib: wxml_lib wcml_example$(EXEEXT)
1414
wkml_lib: wxml_lib wkml_example$(EXEEXT) wkml_example_2$(EXEEXT)
1515
wxml_lib: wxml_example$(EXEEXT)
1616

17+
times: time_test.xml dom_canonicalize.ns.yes.exe
18+
@echo "Timing test is to cannonicalize file: " `du -h test.xml`
19+
./dom_canonicalize.ns.yes.exe
20+
21+
time_test.xml: test.xml
22+
23+
test.xml:
24+
@echo "Creating data file test.xml ..."
25+
@echo "<?xml version='1.0' encoding='utf-8'?>" > test.xml
26+
@echo "<data xmlns='http://www.xml-cml.org/schema'>" >> test.xml
27+
@echo "<line>" >> test.xml ;
28+
@for i in {1..10000}; \
29+
do \
30+
for i in {1..10} ; \
31+
do \
32+
echo "$j 1.206365800459885 0.1074916670129148 0.02144660316977548 0.005740756862772227\c " >> test.xml ;\
33+
done; \
34+
done
35+
@echo "</line>" >> test.xml ;
36+
@echo "</data>" >> test.xml
37+
@echo " ... done"
38+
39+
time_clean:
40+
rm -f test.xml
41+
1742
# Note that we cannot use $< below since IBM make doesn't understand it.
1843

1944
dom_canonicalize.ns.no.exe: dom_canonicalize.ns.no.$(OBJEXT) ../objs/lib/libFoX_dom.$(LIBEXT) ../objs/lib/libFoX_sax.$(LIBEXT) ../objs/lib/libFoX_wxml.$(LIBEXT) ../objs/lib/libFoX_common.$(LIBEXT) ../objs/lib/libFoX_fsys.$(LIBEXT)
@@ -45,5 +70,5 @@ wkml_example$(EXEEXT): wkml_example.$(OBJEXT) ../objs/lib/libFoX_wkml.$(LIBEXT)
4570
wkml_example_2$(EXEEXT): wkml_example_2.$(OBJEXT) ../objs/lib/libFoX_wkml.$(LIBEXT) ../objs/lib/libFoX_wxml.$(LIBEXT) ../objs/lib/libFoX_common.$(LIBEXT) ../objs/lib/libFoX_fsys.$(LIBEXT)
4671
$(FC) $(FFLAGS) $(LDFLAGS) $(LINK_O_FLAG) $@ wkml_example_2.$(OBJEXT) $$(../FoX-config --libs --wkml)
4772

48-
clean:
73+
clean: time_clean
4974
rm -f *.$(OBJEXT) *.$(MOD_EXT) $(EXAMPLES) wkml_example.kml wkml_example_2.kml dom_example_3.xml

0 commit comments

Comments
 (0)