emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please


From: Daniel Colascione
Subject: Re: [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap.
Date: Sun, 23 Mar 2014 19:58:26 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 03/23/2014 07:39 PM, Daniel Colascione wrote:
> On 03/23/2014 06:43 PM, Stefan wrote:
>>> +   * emacs-lisp/cl-macs.el (cl--do-arglist): Use a little `cl-loop'
>>> +   list to look for keyword arguments instead of `memq', fixing
>>> +   (Bug#3647) --- unfortunately, only for freshly-compiled code.
>>> +   Please make bootstrap.
>>
>> Have you checked the performance and code-size impact of this change?
>> Maybe it's OK to try it on trunk, but it seems much too risky
>> performancewise for 24.4.  There is no hurry to fix this: the bug has
>> been with us forever (IIRC it was even documented in CL's texinfo).
> 
> The new code ranges from about a half to a third of the speed of the old
> code, measured by byte-compiled, lexically-bound functions that just
> return lists of their arguments. Code size increases as well: with the
> old code, the 7-old keyword noop function requires 99 bytecode
> instructions, while the new code generates 371 instructions.
> 
> IMHO, that's fine, since keyword argument parsing isn't particularly
> fast to begin with and shouldn't be on any hot path.
> 
> If we really care about performance here, we can add a subr that works
> like assq (`assq-plist' ?), but that skips every other list element.
> This approach should will yield correct semantics and shouldn't be any
> slower (or larger) than the existing code. If you want to do it that
> way, I'll back out my change from the emacs-24 branch and write
> something better for trunk.

Or we can just use plist-member. plist-member produces code that's only
10% slower than the old code and 7% larger: we have an opcode for memq,
but not for plist-member. Is that performance difference small enough
for emacs-24?

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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