Skip to content

Instantly share code, notes, and snippets.

View brixen's full-sized avatar

Brian Shirai brixen

View GitHub Profile
$ bin/rbx -Xrbx.gc_stats compile-ng kernel/
...
Garbage collector stats:
Young (6) total max min average
---------------------------------------------------------------------------------
Collections 97
times 1.20s 24.47m 5.31m 12.39m
objects promoted 557,575 45,470 2,596 5,748.20
class Foo
def initialize(a, b)
blah a
burp b
end
def blah(a)
@a = a
end
gauss:rubinius brian$ bin/rbx -XJ -e '1000.times { 1 }'
Assertion failed: (getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"), function ICmpInst, file vm/external_libs/llvm/include/llvm/Instructions.h, line 722.
gauss:rubinius brian$ git diff kernel/delta/
diff --git a/kernel/delta/profiler.rb b/kernel/delta/profiler.rb
index 172108e..5d2cca0 100644
--- a/kernel/delta/profiler.rb
+++ b/kernel/delta/profiler.rb
@@ -98,6 +98,7 @@ module Rubinius
def flat(out)
total_calls = 0
total = 0.0
+ cumulative_total = 0.0
$ bin/rbx -Xrbx.gc_stats compile-ng -s ^kernel:runtime -T all -V kernel/
Garbage collector stats:
Young (6) total max min average
---------------------------------------------------------------------------------
Collections 159
times 1.59s 55.95m 3.70m 9.98m
objects promoted 624,489 44,572 649 3,927.60
objects copied 4,765,777 54,881 2,851 29,973.44
index % time self children called name
----------------------------------------------------------
3.26 8.84 1827814/5520110 Rubinius::CompiledFile::Marshal#to_varint [10]
1.16 3.04 1680134/3360268 Rubinius::CompiledFile::Marshal#marshal {} [43]
3.78 1.30 728310/8922985 Rubinius::CompiledFile::Marshal#marshal [8]
0.32 0.14 53548/668349 String#gsub [0]
0.34 0.07 31567/608739 Rubinius::Sprintf#parse [0]
0.08 0.03 13756/138301 String#sub [0]
0.07 0.01 8668/77712 String#to_sub_replacement [0]
0.06 0.03 6767/30453 IO#read_all [0]
gauss:rubinius brian$ bin/rbx -r profile compile-ng -s ^kernel:runtime -T all -V kernel/
Total running time: 20.178009108s
% cumulative self self total
time seconds seconds calls ms/call ms/call name
------------------------------------------------------------
9.50 20.12 1.92 295983 0.01 0.07 Array#each
9.00 3.06 1.82 1027797 0.00 0.00 String#<<
4.99 3.07 1.01 468033 0.00 0.01 Rubinius::CompiledFile::Marshal#to_varint
def self.groups
g = []
FFI::MemoryPointer.new(:int, @maxgroups) { |p|
num_groups = Platform::POSIX.getgroups(@maxgroups, p)
Errno.handle if num_groups == -1
g = p.read_array_of_int(num_groups)
}
g
end
gauss:rubinius brian$ ./configure --enable-llvm
Using LLVM: auto
Checking for existing LLVM tree: found!
gauss:rubinius brian$ rake -q clean
(in /Users/brian/devel/rubinius)
LLVM inclusion enabled.
gauss:rubinius brian$ rake -q
(in /Users/brian/devel/rubinius)
LLVM inclusion enabled.
GEN vm/gen/inst_list.hpp
gauss:rubinius brian$ bin/rbx -XJ test.rb
Rehearsal --------------------------------------------
explicit 1.219852 0.000000 1.219852 ( 1.219761)
implicit 0.694078 0.000000 0.694078 ( 0.694147)
----------------------------------- total: 1.913930sec
user system total real
explicit 0.682056 0.000000 0.682056 ( 0.682077)
implicit 0.681555 0.000000 0.681555 ( 0.663507)
gauss:rubinius brian$ bin/rbx test.rb