Skip to content

Instantly share code, notes, and snippets.

diff --git a/gc.c b/gc.c
index 49b54e8..0981e33 100644
--- a/gc.c
+++ b/gc.c
@@ -3005,7 +3017,6 @@ gc_after_sweep(rb_objspace_t *objspace)
/* if heap_pages has unused pages, then assign them to increment */
if (heap_pages_increment < heap_tomb->page_length) {
heap_pages_increment = heap_tomb->page_length;
- heap_pages_expand_sorted(objspace);
}
@authorNari
authorNari / rails_sym_stat.txt
Created March 6, 2014 07:30
Railsのmaster(9f84c7bc48dbcea33149)でrake testしたときのpin downされるdynamic symbol。バックトレースがほぼ同じものでカウントが置い順にソート。
dynamic symbol: 44948
pin symbol: 23265
---------- 4288 ----------
-- rb_pin_dynamic_symbol(start) --
/home/nari/.rbenv/versions/symgc/lib/libruby.so.2.2(+0x1df2f8) vm_dump.c:685
/home/nari/.rbenv/versions/symgc/lib/libruby.so.2.2(+0xfefc5) parse.y:10438
/home/nari/.rbenv/versions/symgc/lib/libruby.so.2.2(+0xff05a) parse.y:10455
/home/nari/.rbenv/versions/symgc/lib/libruby.so.2.2(rb_intern3+0x9d) parse.y:10469
/home/nari/.rbenv/versions/symgc/lib/libruby.so.2.2(+0xf946e) parse.y:8207
/home/nari/.rbenv/versions/symgc/lib/libruby.so.2.2(+0xf9536) parse.y:8233
Elapsed time: 2800.09093603 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name ruby 2.2.0dev (2014-02-20 trunk 45059) [x86_64-linux] built-ruby
app_answer 0.056 0.055
app_aobench 82.763 83.279
app_erb 1.585 1.561
app_factorial 1.007 1.065
@authorNari
authorNari / ouput_backtrace_at_gc.patch
Created December 9, 2013 09:03
GCのタイミングでバックトレース吐く奴。Ruby1.9.3用。
diff --git a/gc.c b/gc.c
index 1d3ac79..2b833da 100644
--- a/gc.c
+++ b/gc.c
@@ -2585,7 +2585,8 @@ garbage_collect(rb_objspace_t *objspace)
{
INIT_GC_PROF_PARAMS;
- if (GC_NOTIFY) printf("start garbage_collect()\n");
+ fprintf(stderr, "garbage_collect(%d)\n", objspace->count);
@authorNari
authorNari / lazy_sweep_factor.patch
Last active December 30, 2015 03:59
eager sweepを指定したオブジェクト生成分遅らせるGC.stressみたいなやつ。Ruby2.0.0用。 環境変数をRUBY_DELAY_SWEEP_INTERVAL=2に設定で「2個生成したあとにsweep,mark」みたいなことができる。 lazy sweepのバグをあぶり出すために作成。
diff --git a/gc.c b/gc.c
index 84af4d6..278661e 100644
--- a/gc.c
+++ b/gc.c
@@ -76,6 +76,7 @@ typedef struct {
unsigned int initial_malloc_limit;
unsigned int initial_heap_min_slots;
unsigned int initial_free_min;
+ unsigned int initial_delay_sweep_interval;
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
@authorNari
authorNari / Gemfile
Created September 5, 2013 01:47
気になる動画の変化を検知してメールしてくれるやつ
source 'https://rubygems.org'
gem 'sqlite3', "1.3.7"
gem 'activerecord', "3.2.13"
gem 'nokogiri', "1.5.9"
gem "gmail-mailer", "0.4.5"
CXX = g++
CXXFLAGS = -g -Wall -fno-rtti -fno-exceptions -shared --std=c++0x -fPIC
GECKO_PATH = /home/nari/apps/xulrunner-sdk-22_x86_64
GECKO_SDK_PATH = $(GECKO_PATH)/sdk
GECKO_IDL_PATH = $(GECKO_PATH)/idl
GECKO_INCLUDE_PATH = $(GECKO_PATH)/include
GECKO_LIB_PATH = $(GECKO_PATH)/lib
@authorNari
authorNari / xchat_hide.py
Created July 12, 2013 06:41
xchat-gnome python plugin
# event list from here.
# https://github.com/xchataqua/xchat/blob/0253ca11761127b59488d0b69dd059dbe9cde699/src/common/textevents.in
# You can load this via following command.
# /py load xchat_hide.py
__module_name__ = "hide print"
__module_version__ = "1.0"
__module_description__ = "Hide unwanted print messages"
__module_author__ = "Narihiro Nakamura <authornar@gmail.com>"
import xchat
-- ruby 1.9.3 r39859
Generating RI format into /home/nari/source/ruby/ruby-github/.ext/rdoc...
Files: 775
Classes: 1375 ( 708 undocumented)
Modules: 305 ( 151 undocumented)
Constants: 2258 ( 828 undocumented)
Attributes: 1020 ( 440 undocumented)
Methods: 10483 (3107 undocumented)
--- ruby 2.0.0 - r41499
Generating RI format into /home/nari/source/ruby/ruby-github/.ext/rdoc...
Files: 907
Classes: 1411 ( 0 undocumented)
Modules: 312 ( 4 undocumented)
Constants: 2282 ( 724 undocumented)
Attributes: 1138 ( 340 undocumented)
Methods: 10859 (2549 undocumented)