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
This commit is contained in:
Torsten Rüger 2019-08-24 11:44:13 +03:00
parent 02261ad79d
commit 259edb51e9
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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