From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: Optimizing ‘string=’
Date: Tue, 22 Jun 2010 23:54:38 +0200 [thread overview]
Message-ID: <m339we91i9.fsf@pobox.com> (raw)
In-Reply-To: <87eifyhhxg.fsf@gnu.org> ("Ludovic Courtès"'s message of "Tue, 22 Jun 2010 23:32:43 +0200")
Greets,
On Tue 22 Jun 2010 23:32, ludo@gnu.org (Ludovic Courtès) writes:
> Andy Wingo <wingo@pobox.com> writes:
>
>> Nasty, but OK I guess if you need it. Why not also add a fast path for
>> scm_is_eq (s1, s2), or for comparing stringbufs, or something ?
>
> Hmm yes. Though if there are too many fast paths the whole thing ends
> up being slow. ;-)
> I don’t expect (eq? s1 s2) and (eq? (string-buf s1) (string-buf s2)) to
> be common enough to warrant a more specific special case, though.
Does it affect your original case at all?. In any event, it doesn't
involve a memory dereference, only a branch. It's a cheap check.
> Because it’s a top-level program, “string=” is looked up at each
> iteration.
Ah, right. Thanks for the explanation :)
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2010-06-22 21:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 19:40 Optimizing ‘string=’ Ludovic Courtès
2010-06-22 20:43 ` Ludovic Courtès
2010-06-23 2:25 ` Mike Gran
2010-06-22 20:51 ` Andy Wingo
2010-06-22 21:32 ` Ludovic Courtès
2010-06-22 21:54 ` Andy Wingo [this message]
2010-07-02 13:32 ` Ludovic Courtès
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/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m339we91i9.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).