Skip to content

Latest commit

 

History

History
58 lines (34 loc) · 1.6 KB

README.rdoc

File metadata and controls

58 lines (34 loc) · 1.6 KB

Aerodrome Service Hours

Description

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.

Installation

git clone http://github.com/thomasnal/aerodrome_service_hours

Run

rails s

Open the browser and navigate to localhost.

Run performance comparison test

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.

Sample input

test/fixtures/input/notamn3.in

Screenshot

Machine code compiled Ruby source

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.)

crystal-lang.org/