[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing ‘string=’

From: Andy Wingo
Subject: Re: Optimizing ‘string=’
Date: Tue, 22 Jun 2010 23:54:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)


On Tue 22 Jun 2010 23:32, address@hidden (Ludovic Courtès) writes:

> Andy Wingo <address@hidden> 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 :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]