9 zscanner code style and compiler options influence
Filip Siroky edited this page 2016-07-25 09:50:49 +02:00

Influence of ragel's code style outputs

Choosing different code style for compiling to C code has in some cases significant influence:

ragelcodestyles

More information on code styles in chapter 5.11 in ragel guide: https://www.colm.net/files/ragel/ragel-guide-6.9.pdf

Source file compilation with gcc and clang

Final time is average value of 10 compilations.

20160718085659

Zscanner in use

On charts below you can see how code style, compiler and compiler options can influence time needed for zscanner to process zone file. To accomplish accurate measurement, zscanner was tested 5 times on the sample zone file, and average value is final outcome of the test.

20160719095252

Try it your self if you wish

Required changes: ~/knot-dns/src/zscanner/ Makefile.am needs to be edited:

This section:

if FAST_PARSER

scanner.c: scanner.c.g2

	cp $(srcdir)/$@.g2 $@

	@echo "NOTE: Compilation of scanner.c can take several minutes!"

else

scanner.c: scanner.c.t0

	cp $(srcdir)/$@.t0 $@

endif	

for: scanner.c: scanner.c

Unzip in ~/knot-dns/scripts/

gcc-clang-tests.zip

Used zone file

se.zone - 861,9 MB https://zonedata.iis.se/

Online tools used for charts

https://live.amcharts.com

http://www.onlinecharttool.com