From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) Date: Thu, 24 Sep 2009 13:05:18 +0900 Message-ID: References: <87skejomoe.fsf@stupidchicken.com> <200909190443.n8J4hBNM011012@godzilla.ics.uci.edu> Reply-To: Kenichi Handa , 4222@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253766640 27687 80.91.229.12 (24 Sep 2009 04:30:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 04:30:40 +0000 (UTC) Cc: cyd@stupidchicken.com, dann@ics.uci.edu To: 4222@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 24 06:30:33 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqfyN-0001xs-2x for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 06:30:32 +0200 Original-Received: from localhost ([127.0.0.1]:33204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqfyM-0001bA-AW for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 00:30:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqfvE-0000Pf-Tg for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 00:27:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mqfv9-0000Mj-Ad for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 00:27:12 -0400 Original-Received: from [199.232.76.173] (port=53734 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqfv9-0000Me-61 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 00:27:07 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46506) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mqfv8-0008Lk-I9 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 00:27:06 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8O4R4oc031792; Wed, 23 Sep 2009 21:27:04 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8O4F4FX029735; Wed, 23 Sep 2009 21:15:04 -0700 Resent-Date: Wed, 23 Sep 2009 21:15:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 24 Sep 2009 04:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4222 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4222-submit@emacsbugs.donarmstrong.com id=B4222.125376512228295 (code B ref 4222); Thu, 24 Sep 2009 04:15:04 +0000 Original-Received: (at 4222) by emacsbugs.donarmstrong.com; 24 Sep 2009 04:05:22 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8O45Ku4028287 for <4222@emacsbugs.donarmstrong.com>; Wed, 23 Sep 2009 21:05:21 -0700 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n8O45IVp022927; Thu, 24 Sep 2009 13:05:18 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n8O45IGq003215; Thu, 24 Sep 2009 13:05:18 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id n8O45ISC010749; Thu, 24 Sep 2009 13:05:18 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Mqfa2-0000Ss-36; Thu, 24 Sep 2009 13:05:18 +0900 In-Reply-To: (message from Kenichi Handa on Sat, 19 Sep 2009 14:37:28 +0900) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 24 Sep 2009 00:27:12 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31435 Archived-At: In article , Kenichi Handa writes: > We still have a problem of slow GC caused by many elements > of char-tables (mostly because of charset encoders). My > idea for fixing it is to somehow distinguish a char-table > that has only integer or (interned) symbol elements from the > other normal char-tables, and optimize mark_char_table for > it. But, at the moment, I don't have a time to work on it. I tried to implement a new function mark_charsets that marks encoder char-tables of charsets in a special way, but it improved the performance only a few percent. It means that the current loop in mark_char_table is fast enough. By the way, I've misunderstood the output of gprof. In article <200908240807.n7O87ubg024643@godzilla.ics.uci.edu>, Dan Nicolaescu writes: > One big difference is then time/number of calls to mark_objects > 129733 vs 18834514, so 145 times more calls to mark_object. > Do you know where do those come from? Emacs 22 didn't have the function mark_vectorlike and mark_object directly handled the marking of Lisp_Vectorlike by recursive call. And the number 129733 doesn't include the number of such recursive calls. The result of profiling this execution: % time LANG=C emacs-22/src/emacs -Q -batch --eval '(dotimes (i 100) (garbage-collect))' shows this: [8] 82.9 1.35 0.01 183705+25673200 mark_object [8] So the total number of calls is 25856905. The similar tries with Emacs 23 and the trunk are: Emacs-23: [12] 76.6 1.64 0.00 28911397+8925193 mark_object [12] Total number of calls is 37836590. The trunk: [12] 64.2 1.13 0.00 14102473+8981954 mark_object [12] Total number of calls is 23084427. It seems that mark_char_table introduced in the trunk works effectively and leads to less object marking than Emacs 22. So, I think we can close this thread. --- Kenichi Handa handa@m17n.org