Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 1 | ITEMS=5000 |
| 2 | CFLAGS=-Wall -O0 |
| 3 | |
Radek Krejci | a9c8ce7 | 2016-01-21 17:25:56 +0100 | [diff] [blame] | 4 | compilation: validation validation_xml addloop |
| 5 | |
| 6 | addloop: addloop.c |
| 7 | $(CC) $(CFLAGS) -lyang $< -o $@ |
Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 8 | |
| 9 | validation: validation.c |
| 10 | $(CC) $(CFLAGS) -lyang $< -o $@ |
| 11 | |
| 12 | validation_xml: validation_xml.c |
| 13 | $(CC) $(CFLAGS) -lxml2 -lxslt $< -o $@ |
| 14 | |
Radek Krejci | a9c8ce7 | 2016-01-21 17:25:56 +0100 | [diff] [blame] | 15 | |
Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 16 | test: validation validation_xml |
Radek Krejci | a9c8ce7 | 2016-01-21 17:25:56 +0100 | [diff] [blame] | 17 | @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 Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 22 | echo "<ptest1 xmlns=\"urn:libyang:performance:test\"><index>$$i</index><p1>$$i</p1></ptest1>" >> data.xml; \ |
Radek Krejci | a9c8ce7 | 2016-01-21 17:25:56 +0100 | [diff] [blame] | 23 | done; |
| 24 | @echo "<config xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">" > data_xml.xml; \ |
Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 25 | cat data.xml >> data_xml.xml; \ |
| 26 | echo "</config>" >> data_xml.xml; \ |
| 27 | echo "Loading and validating data with $(ITEMS) items..."; \ |
Radek Krejci | 14882fb | 2016-01-08 19:30:12 +0100 | [diff] [blame] | 28 | echo "libyang"; \ |
| 29 | TIME=" time : %Es\n memory: %MKb" time ./validation perftest.yin data.xml | grep real | sed 's/* //'; \ |
Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 30 | echo; \ |
Radek Krejci | 14882fb | 2016-01-08 19:30:12 +0100 | [diff] [blame] | 31 | echo "libxml2"; \ |
| 32 | TIME=" time : %Es\n memory: %MKb" time ./validation_xml perftest.yin data_xml.xml perftest-config.rng perftest-schematron.xsl; \ |
Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 33 | |
| 34 | clean: |
Radek Krejci | a9c8ce7 | 2016-01-21 17:25:56 +0100 | [diff] [blame] | 35 | rm -rf validation validation_xml addloop data.xml data_xml.xml addloop_result.xml |
Radek Krejci | 0cbba49 | 2016-01-08 17:24:24 +0100 | [diff] [blame] | 36 | |