Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 746 Bytes

2014-03-26.md

File metadata and controls

32 lines (25 loc) · 746 Bytes

Kashyap

Found this while looking at C source code of ruby:

http://en.wikipedia.org/wiki/Peephole_optimization

There are bunch of compile optimizations that can be enabled/disabled by using the method:

RubyVM::InstructionSequence.compile_option = {
  trace_instruction: false,
  tailcall_optimization: true,
  peephole_optimization: true,
  # ..etc..
}

Default options:

{ :inline_const_cache => true, :peephole_optimization => true, :tailcall_optimization => false, :specialized_instruction => true, :operands_unification => true, :instructions_unification => false, :stack_caching => false, :trace_instruction => true, :debug_level => 0 }