blob: 45e8ccda98823bb6e190bafc4de37853f48bbd39 [file] [log] [blame]
Radek Krejci0cbba492016-01-08 17:24:24 +01001ITEMS=5000
2CFLAGS=-Wall -O0
3
Radek Krejcia9c8ce72016-01-21 17:25:56 +01004compilation: validation validation_xml addloop
5
6addloop: addloop.c
7 $(CC) $(CFLAGS) -lyang $< -o $@
Radek Krejci0cbba492016-01-08 17:24:24 +01008
9validation: validation.c
10 $(CC) $(CFLAGS) -lyang $< -o $@
11
12validation_xml: validation_xml.c
13 $(CC) $(CFLAGS) -lxml2 -lxslt $< -o $@
14
Radek Krejcia9c8ce72016-01-21 17:25:56 +010015
Radek Krejci0cbba492016-01-08 17:24:24 +010016test: validation validation_xml
Radek Krejcia9c8ce72016-01-21 17:25:56 +010017 @rm -rf data.xml data_xml.xml addloop_result.xml; \
18 echo "Adding 5000 list items one by one (libyang)"; \
19 TIME=" time : %Es\n memory: %MKb" time ./addloop perftest.yin | grep real | sed 's/* //'; \
20 echo;
21 @for i in $(shell seq 1 ${ITEMS}); do \
Radek Krejci0cbba492016-01-08 17:24:24 +010022 echo "<ptest1 xmlns=\"urn:libyang:performance:test\"><index>$$i</index><p1>$$i</p1></ptest1>" >> data.xml; \
Radek Krejcia9c8ce72016-01-21 17:25:56 +010023 done;
24 @echo "<config xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" > data_xml.xml; \
Radek Krejci0cbba492016-01-08 17:24:24 +010025 cat data.xml >> data_xml.xml; \
26 echo "</config>" >> data_xml.xml; \
27 echo "Loading and validating data with $(ITEMS) items..."; \
Radek Krejci14882fb2016-01-08 19:30:12 +010028 echo "libyang"; \
29 TIME=" time : %Es\n memory: %MKb" time ./validation perftest.yin data.xml | grep real | sed 's/* //'; \
Radek Krejci0cbba492016-01-08 17:24:24 +010030 echo; \
Radek Krejci14882fb2016-01-08 19:30:12 +010031 echo "libxml2"; \
32 TIME=" time : %Es\n memory: %MKb" time ./validation_xml perftest.yin data_xml.xml perftest-config.rng perftest-schematron.xsl; \
Radek Krejci0cbba492016-01-08 17:24:24 +010033
34clean:
Radek Krejcia9c8ce72016-01-21 17:25:56 +010035 rm -rf validation validation_xml addloop data.xml data_xml.xml addloop_result.xml
Radek Krejci0cbba492016-01-08 17:24:24 +010036