1 of 4

monoruby進捗

https://github.com/sisshiki1969/monoruby

Meetup#52 2023/9/10

2 of 4

optcarrot benchmark

frame per sec

3 of 4

optimization

  • Use BcIr::MethodCall for “<<” and “>>” ops.
  • Support CMOV
  • Deoptimize when Load/StoreIvar are not cached.
  • Inline Integer#%
  • Inline Array#<<
  • Support polymorphic inline method cache for Object#send.

4 of 4

Class: C

VarTable

ObjKind::Object

@a => slot 0

@b => slot 1

@c => slot 2

@d => slot 3

@e => slot 4

@f => slot 5

@g => slot 6

Class: C

VarTable

ObjKind::Object

インスタンス変数の高速化:オブジェクト内にembed

  • オブジェクト内の空き領域に格納する
  • メモリ消費が減る
  • 速い
  • Objectクラスのみ適用可 他のクラス(のサブクラス)はVarTableを使用

0:Some(42)

1:Some(0)

2:None

Class C InstanceVarMap

0:None

1:Some(77)

2:Some(55)

3: Some(72)

4: Some(“a”)

5: None

6: Some(:a)