This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby 3.3.0dev (2023-03-14T07:07:59Z master ac65ce16e9) [aarch64-linux] | |
-------------- ----------- ---------- --------- ---------- ----------- ------------ | |
bench interp (ms) stddev (%) yjit (ms) stddev (%) interp/yjit yjit 1st itr | |
activerecord 206.9 0.9 97.5 1.3 2.12 0.62 | |
hexapdf 4940.6 1.0 2415.3 2.2 2.05 1.20 | |
liquid-c 88.9 2.0 61.9 3.4 1.44 0.30 | |
liquid-render 300.5 1.7 135.3 3.1 2.22 0.64 | |
mail 209.0 0.6 104.6 3.7 2.00 0.32 | |
psych-load 4474.7 0.3 1887.1 0.1 2.37 2.24 | |
railsbench 2794.2 0.5 1544.4 1.5 1.81 0.74 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUBY_T_MASK = 0x1f | |
RUBY_T_STRING = 0x05 | |
RUBY_T_ARRAY = 0x07 | |
RSTRING_EMBED_LEN_SHIFT = 0x0e | |
RSTRING_EMBED_LEN_MASK = 0x7c000 | |
RSTRING_NOEMBED = 0x2000 | |
RARRAY_EMBED_FLAG = 0x2000 | |
RARRAY_EMBED_LEN_SHIFT = 0x0f | |
RARRAY_EMBED_LEN_MASK = 0x18000 | |
RUBY_ID_SCOPE_SHIFT = 0x4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <sched.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/wait.h> | |
#include <time.h> | |
#include <unistd.h> | |
int main_parent(pid_t child_pid) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kj@kj-thinkpad ~ % cat rename.rb | |
#!/usr/bin/env ruby | |
require 'fiddle' | |
libruby = Fiddle::Handle.new | |
rb_set_class_path_string = Fiddle::Function.new( | |
libruby['rb_set_class_path_string'], | |
[ | |
Fiddle::TYPE_UINTPTR_T, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <curl/curl.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#define NUM_THREADS 20 | |
static pthread_mutex_t outlock = PTHREAD_MUTEX_INITIALIZER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Riak protocol decoder | |
-- Based on copypasta from https://wiki.wireshark.org/Protobuf.md | |
-- To use, | |
-- * Plase in ~/.local/lib/wireshark/plugins/riak.lua | |
-- * Check out https://github.com/protocolbuffers/protobuf somewhere | |
-- * Check out https://github.com/basho/riak_pb somewhere | |
-- * In the "ProtoBuf" protocol preferences, add protobuf/src and riak_pb/src | |
-- to the search paths. Make sure "load all" is checked for riak_pb, but NOT | |
-- for protobuf. | |
-- * right click a stream -> decode as -> "RIAK_PROTO" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With memocache: | |
kj@kj-thinkpad ruby_memprofiler_pprof % ruby script/benchmark.rb | |
user system total real | |
no profiling (1) 15.844936 0.469273 16.314209 ( 16.337021) | |
no profiling (2) 14.966771 0.034934 15.001705 ( 15.020942) | |
with profiling (1%, no flush) 15.971306 0.477258 16.448564 ( 16.471195) | |
with reporting (1%, with flush) 17.402173 0.029948 17.432121 ( 17.454925) | |
with profiling (10%, no flush) 23.168302 0.289576 23.457878 ( 23.487329) | |
with reporting (10%, with flush) 48.194583 0.042943 48.237526 ( 48.290087) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Samples: 8K of event 'cycles', Event count (approx.): 367381525322, DSO: ruby_memprofiler_pprof_ext.so | |
Children Self Comm Symbol | |
+ 60.45% 0.00% ruby [.] collector_cdata_gc_mark ▒ | |
+ 60.34% 0.03% ruby [.] collector_gc_mark_each_heap_sample ▒ | |
+ 60.30% 0.26% ruby [.] mpp_sample_gc_mark ▒ | |
+ 0.74% 0.00% ruby [.] collector_tphook_newobj ▒ | |
0.04% 0.00% ruby [.] collector_tphook_freeobj ▒ | |
0.02% 0.01% ruby [.] mpp_rb_gc_disable_no_rest ▒ | |
0.01% 0.01% ruby [.] backtracie_bt_gc_mark_moveable@plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kj@kj-thinkpad ruby_memprofiler_pprof % ruby script/benchmark.rb | |
user system total real | |
no profiling (1) 15.867480 0.473907 16.341387 ( 16.382863) | |
no profiling (2) 14.955051 0.031678 14.986729 ( 15.025699) | |
with profiling (1%, no flush) 22.981310 0.484232 23.465542 ( 23.501221) | |
with reporting (1%, with flush) 24.261126 0.057177 24.318303 ( 24.353663) | |
with profiling (10%, no flush) 109.202573 0.291814 109.494387 (109.596998) | |
with reporting (10%, with flush) 154.720902 0.060936 154.781838 (154.920858) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 heap_page_add_freeobj (objspace=0xeb9800, page=0x153da2c0, obj=139975204190960) at gc.c:1850 | |
#1 0x00007f4e98cf35ab in gc_sweep_plane (objspace=0xeb9800, heap=0xeb9838, p=139975204190960, bitset=1, ctx=0x7ffe5ff47e20) at gc.c:5293 | |
#2 0x00007f4e98cf39ad in gc_sweep_page (objspace=0xeb9800, size_pool=0xeb9828, heap=0xeb9838, ctx=0x7ffe5ff47e20) at gc.c:5389 | |
#3 0x00007f4e98cf3f89 in gc_sweep_step (objspace=0xeb9800, size_pool=0xeb9828, heap=0xeb9838) at gc.c:5665 | |
#4 0x00007f4e98cf485d in gc_sweep (objspace=0xeb9800) at gc.c:5900 | |
#5 0x00007f4e98cf8c49 in gc_marks_rest (objspace=0xeb9800) at gc.c:8100 | |
#6 0x00007f4e98cf8daf in gc_marks (objspace=0xeb9800, full_mark=0) at gc.c:8151 | |
#7 0x00007f4e98cfae13 in gc_start (objspace=0xeb9800, reason=512) at gc.c:8967 | |
#8 0x00007f4e98cfaa8a in garbage_collect (objspace=0xeb9800, reason=512) at gc.c:8853 | |
#9 0x00007f4e98cfb567 in garbage_collect_with_gvl (objspace=0xeb9800, reason=512) at gc.c:9225 |