From 259edb51e990472b6e4493c05cf8df25c9852d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20R=C3=BCger?= Date: Sat, 24 Aug 2019 11:44:13 +0300 Subject: [PATCH] adding parfait options to compiler to make smaller binaries with larger integer heaps also ran some benchmarks to see if it makes a difference at least the binaries are smaller, calling also faster --- lib/rubyx/rubyxc.rb | 6 ++++-- test/bench/results.md | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/rubyx/rubyxc.rb b/lib/rubyx/rubyxc.rb index dc136487..3b1a2da4 100644 --- a/lib/rubyx/rubyxc.rb +++ b/lib/rubyx/rubyxc.rb @@ -3,7 +3,8 @@ require "rubyx" require "risc/interpreter" class RubyXC < Thor - class_option :parfait , type: :numeric + class_option :integers , type: :numeric + class_option :mesages , type: :numeric desc "compile FILE" , "Compile given FILE to binary" @@ -98,7 +99,8 @@ class RubyXC < Thor private def extract_options - opt = { factory: options[:parfait] || 1024 } + opt = { Integer: options[:integers] || 1024 , + Message: options[:messages] || 1024} return {parfait: opt} end diff --git a/test/bench/results.md b/test/bench/results.md index 22e3b4b2..1660f936 100644 --- a/test/bench/results.md +++ b/test/bench/results.md @@ -1,4 +1,4 @@ -# Benchmarks + # Benchmarks hello - output hello world to measure kernel calls add - run integer adds by linear fibonacci of 40 @@ -25,6 +25,6 @@ Results (in ms) should be seen as relative, not absolute. language | noop | hello | add | call | loop c | 55 | 380 | 88 | 135 | 6 go | 52 | 450 | 9 | 77 | 2 -rubyx | 42 | 200 | 1700 | 1700 | 480 +rubyx | 42 | 200 | 1700 | 1450 | 470 ruby | 1570 | 650 | 1090 | 1500 | 180 mruby | 86 | 1200 | 1370 | 2700 | 300