From: Jesper Harder <harder@ifa.au.dk>
Subject: gnus-correct-length vs. string-width
Date: Fri, 28 Dec 2001 15:26:49 +0100 [thread overview]
Message-ID: <m3sn9vctee.fsf@defun.localdomain> (raw)
Is the built-in function `string-width' known to be broken?
I'm asking because the Gnus substitute `gnus-correct-length' seems to be
horribly expensive in comparison -- it really degrades performance when
generating summary buffers. Here's the elp results for entering an NNTP
group with 4000 messages:
Function Name Call Count Elapsed Time Average Time
==================================== ========== ============ ============
gnus-topic-select-group 1 103.839829 103.839829
gnus-group-select-group 1 103.839535 103.839535
gnus-group-read-group 1 103.839481 103.839481
gnus-summary-read-group 1 103.839243 103.839243
gnus-summary-read-group-1 1 103.839173 103.839173
gnus-summary-prepare 1 72.383289 72.383289
gnus-summary-prepare-threads 1 69.354715 69.354715
gnus-correct-length 16000 39.978197000 0.0024986373
... and the same results after doing:
(defalias 'gnus-correct-length 'string-width)
Function Name Call Count Elapsed Time Average Time
==================================== ========== ============ ============
gnus-topic-select-group 1 66.504824 66.504824
gnus-group-select-group 1 66.50452 66.50452
gnus-group-read-group 1 66.504463 66.504463
gnus-summary-read-group 1 66.504229 66.504229
gnus-summary-read-group-1 1 66.504158 66.504158
gnus-summary-prepare 1 34.509797 34.509797
gnus-select-newsgroup 1 31.573028 31.573028
gnus-summary-prepare-threads 1 31.530489 31.530489
...
gnus-correct-length 16000 0.2750719999 1.719...e-05
I.e. this is about 35% faster.
next reply other threads:[~2001-12-28 14:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-28 14:26 Jesper Harder [this message]
2001-12-28 17:22 ` Simon Josefsson
2001-12-28 23:24 ` Lars Magne Ingebrigtsen
2002-01-05 7:00 ` Daniel Pittman
2002-01-05 16:08 ` Lars Magne Ingebrigtsen
2002-01-06 11:25 ` Daniel Pittman
2001-12-30 1:32 ` Jesper Harder
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3sn9vctee.fsf@defun.localdomain \
--to=harder@ifa.au.dk \
/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.
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 NNTP newsgroup(s).