plans for world domination [ruby style]

15 views
Skip to first unread message

rogerdpack

unread,
Nov 18, 2009, 11:20:50 AM11/18/09
to ruby optimization
I'm almost wondering if rubinius would be a better match for the
optimization stuffs, because in MRI...

when you do IO#puts, it actually internally does several ruby calls,
like rb_funcall xxx

If we want to avoid ruby func calls, because they're slow, you can
convert rubinius' internals to straight C, but not MRI.
I.e. with MRI the internals are still a bit slow.
Maybe I should chat with the rubinius guys about it.
-r

rogerdpack

unread,
Nov 18, 2009, 11:38:05 AM11/18/09
to ruby optimization
> when you do IO#puts, it actually internally does several ruby calls,
> like rb_funcall xxx

looks like IO#puts only does one extra call internally

["c-call", "go.rb", 2, :puts, #<Binding:0x2964e70>, Kernel]
["c-call", "go.rb", 2, :write, #<Binding:0x2964e28>, IO]

so maybe this isn't such a huge problem.

My next question is...why is regex lookup on 1.9 twice the speed of
1.8?

Caleb Clausen

unread,
Nov 18, 2009, 11:41:53 AM11/18/09
to ruby-opt...@googlegroups.com

rb_funcalls in c code can also be analyzed by type induction. I've not
spent a lot of time thinking about that because its (I assume) a
relatively minor cpu user and it requires another completely different
mechanism in order the accomplish the induction and associated rewriting.

Caleb Clausen

unread,
Nov 18, 2009, 11:43:13 AM11/18/09
to ruby-opt...@googlegroups.com
rogerdpack wrote:
> My next question is...why is regex lookup on 1.9 twice the speed of
> 1.8?

oniguruma?

Reply all
Reply to author
Forward
0 new messages