[ruby-core:32783] replacing rb_intern

From: Ondřej Bílka <neleai@...>
Date: 2010-10-14 07:24:18 UTC
List: ruby-core #32783
Hello

I have idea to speed up ruby a bit

Typical use of rb_intern looks like this
  if (!rb_respond_to(str2, rb_intern("to_str"))) {
	      return Qfalse;

which could be replaced by
  if (!rb_respond_to(str2, id_to_str)) {
	        return Qfalse;

I propose to use script which replaces all occurences of rb_intern("foo") by id_foo, defines id_foo and initializes it at Init_ function.

Any comments?

-- 

Budget cuts

In This Thread

Prev Next