Skip to content

Commit

Permalink
Examples: add times target
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andreww committed Mar 10, 2013
1 parent 7ff99f6 commit 0a56452
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ wcml_lib: wxml_lib wcml_example$(EXEEXT)
wkml_lib: wxml_lib wkml_example$(EXEEXT) wkml_example_2$(EXEEXT)
wxml_lib: wxml_example$(EXEEXT)

times: time_test.xml dom_canonicalize.ns.yes.exe
@echo "Timing test is to cannonicalize file: " `du -h test.xml`
./dom_canonicalize.ns.yes.exe

time_test.xml: test.xml

test.xml:
@echo "Creating data file test.xml ..."
@echo "<?xml version='1.0' encoding='utf-8'?>" > test.xml
@echo "<data xmlns='http://www.xml-cml.org/schema'>" >> test.xml
@echo "<line>" >> test.xml ;
@for i in {1..10000}; \
do \
for i in {1..10} ; \
do \
echo "$j 1.206365800459885 0.1074916670129148 0.02144660316977548 0.005740756862772227\c " >> test.xml ;\
done; \
done
@echo "</line>" >> test.xml ;
@echo "</data>" >> test.xml
@echo " ... done"

time_clean:
rm -f test.xml

# Note that we cannot use $< below since IBM make doesn't understand it.

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)
Expand Down Expand Up @@ -45,5 +70,5 @@ wkml_example$(EXEEXT): wkml_example.$(OBJEXT) ../objs/lib/libFoX_wkml.$(LIBEXT)
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)
$(FC) $(FFLAGS) $(LDFLAGS) $(LINK_O_FLAG) $@ wkml_example_2.$(OBJEXT) $$(../FoX-config --libs --wkml)

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

0 comments on commit 0a56452

Please sign in to comment.