From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id E76FE19C0020 for ; Fri, 23 Oct 2015 05:27:44 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 64849B5D870 for ; Fri, 23 Oct 2015 05:54:57 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 50F24952408 for ; Fri, 23 Oct 2015 05:54:57 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C20741204DB; Fri, 23 Oct 2015 05:54:54 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 4833C1204C7 for ; Fri, 23 Oct 2015 05:54:50 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=2V8Je/SrPmhkVs48Z81rsZQS2iM=; b=xU7uXes6k6HyYC6duy ECOCR7G4hlRHzvKb5w4XRnb4R76Owfv8VbjiUcgBLgWAFPmogjYOBvgPopGnZUQw 4eKu1K9O4ErJEt25DuLPkLj5SudUshBtIXXD9nBWSq/OwFZDk8o296wQuuqyxCyh 3sB724KKU0bpxHLethVHjqmXY= Received: by filter-157.sjc1.sendgrid.net with SMTP id filter-157.29568.56294D14C 2015-10-22 20:54:44.17246456 +0000 UTC Received: from herokuapp.com (ec2-54-92-167-20.compute-1.amazonaws.com [54.92.167.20]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id ayfzJnA8RG2QOToRxkuCgg for ; Thu, 22 Oct 2015 20:54:44.074 +0000 (UTC) Date: Thu, 22 Oct 2015 20:54:44 +0000 From: normalperson@yhbt.net To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45790 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11614 X-Redmine-Issue-Author: normalperson X-Redmine-Sender: normalperson X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5QqyfHd9uAG4Gw3l5Iezx+Tzn9+rRYt0MOJU RPMRNoyEdHaDLOq3Qcdr1vJWdOwgvStKHZIDvit6lqjM35zwOR/eJCFWRyzbT77PEtCm9O14AcSXz7 ZdTek5Uh0UD3h1I= X-SendGrid-Contentd-ID: {"test_id":"1445547285"} X-ML-Name: ruby-core X-Mail-Count: 71164 Subject: [ruby-core:71164] [Ruby trunk - Feature #11614] [Open] [RFC] use id_table for constant tables X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11614 has been reported by Eric Wong. ---------------------------------------- Feature #11614: [RFC] use id_table for constant tables https://bugs.ruby-lang.org/issues/11614 * Author: Eric Wong * Status: Open * Priority: Normal * Assignee: ---------------------------------------- ref: [ruby-core:71142] [ruby-core:71151] I'm not sure if using rb_class_name in object.c is enough to prevent breaking all existing code. Until this is sufficiently reviewed, I have no plans to commit this patch at the moment. valgrind 3.9.0 on x86-64 reports a minor reduction in memory usage when loading only RubyGems and RDoc by running: ruby -rrdoc -eexit before: HEAP SUMMARY: in use at exit: 2,913,448 bytes in 27,394 blocks total heap usage: 48,362 allocs, 20,968 frees, 9,034,621 bytes alloc after: HEAP SUMMARY: in use at exit: 2,880,056 bytes in 26,712 blocks total heap usage: 47,791 allocs, 21,079 frees, 9,046,507 bytes alloc * class.c (struct clone_const_arg): adjust for id_table (clone_const): ditto (clone_const_i): ditto (rb_mod_init_copy): ditto (rb_singleton_class_clone_and_attach): ditto (rb_include_class_new): ditto (include_modules_at): ditto * constant.h (rb_free_const_table): ditto * gc.c (free_const_entry_i): ditto (rb_free_const_table): ditto (obj_memsize_of): ditto (mark_const_entry_i): ditto (mark_const_tbl): ditto * internal.h (struct rb_classext_struct): ditto * object.c (rb_mod_const_set): resolve class name on assignment * variable.c (const_update): replace with const_tbl_update (const_tbl_update): new function (fc_i): adjust for id_table (find_class_path): ditto (autoload_const_set): st_update => const_tbl_update (rb_const_remove): adjust for id_table (sv_i): ditto (rb_local_constants_i): ditto (rb_local_constants): ditto (rb_mod_const_at): ditto (rb_mod_const_set): ditto (rb_const_lookup): ditto ---Files-------------------------------- 0001-use-id_table-for-constant-tables.patch (18.3 KB) -- https://bugs.ruby-lang.org/