From 91d99025e4776885ceea809123a129cb31cd1db6 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Thu, 3 Dec 2020 15:57:39 +0900 Subject: per-ractor object allocation Now object allocation requires VM global lock to synchronize objspace. However, of course, it introduces huge overhead. This patch caches some slots (in a page) by each ractor and use cached slots for object allocation. If there is no cached slots, acquire the global lock and get new cached slots, or start GC (marking or lazy sweeping). --- ractor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ractor.c') diff --git a/ractor.c b/ractor.c index 49a92a2661..64e20b46e7 100644 --- a/ractor.c +++ b/ractor.c @@ -1230,6 +1230,7 @@ rb_ractor_main_alloc(void) r->id = ++ractor_last_id; r->loc = Qnil; r->name = Qnil; + r->self = Qnil; ruby_single_main_ractor = r; return r; @@ -2154,7 +2155,6 @@ static VALUE ractor_reset_belonging(VALUE obj) { #if RACTOR_CHECK_MODE > 0 - rp(obj); rb_obj_traverse(obj, reset_belonging_enter, null_leave, NULL); #endif return obj; -- cgit v1.2.3