Skip to content

Instantly share code, notes, and snippets.

View ryoqun's full-sized avatar

Ryo Onodera ryoqun

View GitHub Profile
Run options:
# Running tests:
_add_remove_loop_outer
_add_remove_loop_outer: 0
[{:meth=>:_add_remove_loop_outer, :time=>"20.496842s", :loop_count=>5, :key_count=>6142}, 620, -1311, 87, -423, -80, -227, 460, -244, -93, -18, -214, 1487, -649, 397, -144, -899, 408, -603, -95, -1375, 335, 34, 2009, 986, 427, -985, 1130, 1656, 956, 226, -470, -798, 147, 169, -455, 192, -183, -402, 310, 474]
_add_remove_loop_outer
[{:meth=>:_add_remove_loop_outer, :time=>"11.912187s", :loop_count=>25, :key_count=>307}, 179, 1258, -81, -224, 25, -152, -463, 409, 816, -1353, 457, -4, -88, -333, 75, 144, -386, 86, 808, -451, 92, -230, 49, 105, 161, 377, -198, -754, 941, -270, -36, -540, -910, 513, -294, 275, 401, -123, -156, -125]
_add_remove_loop_outer
highlight WhitespaceEOL ctermbg=red
match WhitespaceEOL /\s\+$/
set wildmenu
set hlsearch
set number
set expandtab
set shiftwidth=2
set softtabstop=2
set hidden
set ambiwidth=double
ryoqun@rrm:~/rubinius/ryoqun$ git grep 'def.*[a-z_]$' ./kernel/ | head
kernel/alpha.rb:# The classes, modules, and methods defined here provide basic
kernel/alpha.rb:# NOTE: The order of these definitions is important. Do not
kernel/alpha.rb: def self.show_backtrace
kernel/alpha.rb: def __show__
kernel/alpha.rb: def allocate
kernel/alpha.rb: def class
kernel/alpha.rb: def __class__
kernel/alpha.rb: # By default, the representation is the name of the object's
kernel/alpha.rb: def to_s
ryoqun@rrm:~/rubinius/central$ git grep 'alias_method\b' ./kernel/ | grep to_s | grep inspect
kernel/bootstrap/thread.rb: alias_method :to_s, :inspect
kernel/common/array19.rb: alias_method :to_s, :inspect
kernel/common/float.rb: alias_method :inspect, :to_s
kernel/common/hash19.rb: alias_method :to_s, :inspect
kernel/common/hash_hamt.rb: alias_method :to_s, :inspect
kernel/common/main.rb: alias_method :inspect, :to_s
kernel/common/method.rb: alias_method :to_s, :inspect
kernel/common/method.rb: alias_method :to_s, :inspect
kernel/common/proc18.rb: alias_method :inspect, :to_s
@ryoqun
ryoqun / gist:5090624
Last active December 14, 2015 12:59
initial jit profiling
: def has_dynamic_locals?
1010 0.2431 : @dynamic_locals
: end
:
19396 4.6684 : def dynamic_locals
15260 3.6729 : @dynamic_locals ||= Rubinius::LookupTable.new
: end
:
: def set_eval_local(name, val)
719 0.1731 : scope = @parent
@ryoqun
ryoqun / gist:5097785
Created March 6, 2013 08:59
correct profiling confirmed
13306 2.8983 :def inner(i) /* _X_Object#inner@1 total: 42441 9.2445 */
4454 0.9702 : i += 1
6015 1.3102 : i += 1
3552 0.7737 : i += 1
30494 6.6422 : i += (i + 174) - (306 + i) + (-32 - i)
4078 0.8883 : i += 1
5071 1.1046 : i += 1
5409 1.1782 : i += 1
5101 1.1111 : i += 1
6711 1.4618 : i += 1
@ryoqun
ryoqun / gist:5097799
Created March 6, 2013 09:00
imporoved profiling!
: def has_dynamic_locals?
4329 0.4283 : @dynamic_locals
: end
:
37689 3.7291 : def dynamic_locals
47619 4.7116 : @dynamic_locals ||= Rubinius::LookupTable.new
: end
:
47433 4.6932 : def set_eval_local(name, val) /* _X_Rubinius::VariableScope#set_eval_local@2 total: 147284 14.5728 */
1261 0.1248 : scope = @parent
/*
* Command line: opannotate --merge all image:/home/ryoqun/rubinius/ryoqun/bin/rbx --assembly
*
* Interpretation of command line:
* Output annotated assembly listing with samples
*
* CPU: Core 2, speed 1.995e+06 MHz (estimated)
* Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
*/
:
/*
* Command line: opannotate --merge all image:/home/ryoqun/rubinius/ryoqun/bin/rbx --assembly
*
* Interpretation of command line:
* Output annotated assembly listing with samples
*
* CPU: Core 2, speed 1.995e+06 MHz (estimated)
* Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
*/
:
diff --git a/libopagent/opagent.h b/libopagent/opagent.h
index 9a4c860..de211c6 100644
--- a/libopagent/opagent.h
+++ b/libopagent/opagent.h
@@ -29,6 +29,7 @@
#define _LIB_OPAGENT_H
#include <sys/types.h>
+#include <stdint.h>