This is a Ruby on Rails application that displays list of aerodrome service hours. Input is provided by posting an input text file through the form.
git clone http://github.com/thomasnal/aerodrome_service_hours
rails s
Open the browser and navigate to localhost.
rake test:benchmark
This is a comparison of Parser vs ParserPlain model. ParserPlain is a plain, one method, regular expression version of the parser. The test runs on 30000 Notamn records made of notamn3.in input file.
test/fixtures/input/notamn3.in
I investigated performance of the ruby code compiled into machine code. The processing time gets more than halved therefore considerably increasing performance comparing to Ruby interpreter.
apt-get install crystal cd $(PROJECT_ROOT)/vendor/crystal crystal build parser.cr --release ./parser
To run side by side benchmarks of machine code vs interpreted by Ruby,
./notamn_in_prep.sh # to build input file ./parser ruby parser.rb
Sample result,
Hello Crystal 0.003342 0.000076 0.003418 ( 2.053490) Number of notamns: 20001 Hello Ruby 4.530000 0.070000 4.600000 ( 4.617555) Number of notamns: 20001
(Beware, to achieve this performance use the Crystal working copy or a newer version than 0.12 once released. Bug in StringScanner decreases performance.)