View fuu.diff
diff --git a/configure b/configure
index d0f10ed..e6567d0 100755
--- a/configure
+++ b/configure
@@ -110216,7 +110216,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -dynamiclib \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
View x.rb
if ENV['COMP']
set_load_required_file_func ->(full_path) {
fname = full_path + "o"
if File.exist? fname
insns = RubyVM::InstructionSequence.load_from_binary File.binread fname
insns.eval
true
else
View foo.rb
require 'benchmark/ips'
LONG_STRING = " this is a longer test
this is a longer test
this is a longer test
this is a longer test
this is a longer test"
class String
def original_blank?
View test.rb
ruby_code = <<-eorby
def foo bar, baz
p bar
p baz
end
foo
eorby
puts RubyVM::InstructionSequence.new(ruby_code).disasm
puts RubyVM::InstructionSequence.new(ruby_code, nil, nil, 0, :operands_unification => false).disasm
View singleton_patch.diff
diff --git a/class.c b/class.c
index 0261838..65428be 100644
--- a/class.c
+++ b/class.c
@@ -1591,7 +1591,9 @@ singleton_class_of(VALUE obj)
klass = RBASIC(obj)->klass;
if (!(FL_TEST(klass, FL_SINGLETON) &&
rb_ivar_get(klass, id_attached) == obj)) {
+ rb_serial_t serial = RCLASS_SERIAL(klass);
klass = rb_make_metaclass(obj, klass);
View singleton_speed.rb
require 'benchmark'
class Foo
def bar; end
end
singleton = (100_000 * 20).times.map do |i|
foo = Foo.new
foo.singleton_class
foo
View singleton_speed.rb
require 'benchmark/ips'
class Foo
def bar; end
end
def ic_hit obj
obj.bar
end
View rspec_cache.txt
[aaron@TC Bath (master)]$ rspec rspec_test.rb
{:global_method_state=>142, :global_constant_state=>1332, :class_serial=>14849}
.{:global_method_state=>142, :global_constant_state=>1332, :class_serial=>14850}
.{:global_method_state=>142, :global_constant_state=>1332, :class_serial=>14851}
.
Finished in 0.00076 seconds (files took 0.13633 seconds to load)
3 examples, 0 failures
[aaron@TC Bath (master)]$ lldb `rbenv which ruby` -- -S `rbenv which rspec` rspec_test.rb
View ruby_23_stat.txt
$ sudo dtrace -q -n 'syscall::stat*:entry { printf("%s\n", copyinstr(arg0)); }' -c`rbenv which ruby`" -e'\ '"
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/enc/encdb.bundle
dtrace: error on enabled probe ID 3 (ID 826: syscall::stat64:entry): invalid user access in action #1 at DIF offset 24
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/enc/trans/transdb.bundle
dtrace: error on enabled probe ID 3 (ID 826: syscall::stat64:entry): invalid user access in action #1 at DIF offset 24
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/stringio.bundle
dtrace: error on enabled probe ID 3 (ID 826: syscall::stat64:entry): invalid user access in action #1 at DIF offset 24
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/specifications/default/bigdecimal-1.2.8.gemspec
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/specifications/default/io-console-0.4.5.gemspec
View hash_speed.rb
require 'benchmark/ips'
class Foo
alias :object_hash :hash
attr_reader :hash
def initialize
@hash = object_hash
end
end