From: Kenichi Handa <handa@m17n.org>
To: 4222@emacsbugs.donarmstrong.com
Cc: cyd@stupidchicken.com, dann@ics.uci.edu
Subject: bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3)
Date: Thu, 24 Sep 2009 13:05:18 +0900 [thread overview]
Message-ID: <tl7ljk5kmwx.fsf@m17n.org> (raw)
In-Reply-To: <tl7tyyzlckn.fsf@m17n.org> (message from Kenichi Handa on Sat, 19 Sep 2009 14:37:28 +0900)
In article <tl7tyyzlckn.fsf@m17n.org>, Kenichi Handa <handa@m17n.org> 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 <dann@ics.uci.edu> 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 <cycle 2> [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 <cycle 2> [12]
Total number of calls is 37836590.
The trunk:
[12] 64.2 1.13 0.00 14102473+8981954 mark_object <cycle 2> [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
next prev parent reply other threads:[~2009-09-24 4:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 23:30 bug#4222: calls to char_table_ref slow down 23.1 (vs 22.3) Chong Yidong
2009-09-19 4:43 ` Dan Nicolaescu
2009-09-19 5:37 ` Kenichi Handa
2009-09-24 4:05 ` Kenichi Handa [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-08-21 5:18 Dan Nicolaescu
2009-08-21 6:34 ` Kenichi Handa
2009-08-21 7:08 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tl7ljk5kmwx.fsf@m17n.org \
--to=handa@m17n.org \
--cc=4222@emacsbugs.donarmstrong.com \
--cc=cyd@stupidchicken.com \
--cc=dann@ics.uci.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).