all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap.
       [not found] <E1WRbSg-00088X-MH@vcs.savannah.gnu.org>
@ 2014-03-24  1:43 ` Stefan
  2014-03-24  2:39   ` Daniel Colascione
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan @ 2014-03-24  1:43 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: emacs-devel

> +	* 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).


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap.
  2014-03-24  1:43 ` [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap Stefan
@ 2014-03-24  2:39   ` Daniel Colascione
  2014-03-24  2:58     ` Daniel Colascione
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Colascione @ 2014-03-24  2:39 UTC (permalink / raw)
  To: Stefan; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap.
  2014-03-24  2:39   ` Daniel Colascione
@ 2014-03-24  2:58     ` Daniel Colascione
  2014-03-24 13:12       ` Stefan
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Colascione @ 2014-03-24  2:58 UTC (permalink / raw)
  To: Stefan; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap.
  2014-03-24  2:58     ` Daniel Colascione
@ 2014-03-24 13:12       ` Stefan
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan @ 2014-03-24 13:12 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: emacs-devel

> 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?

Yes, that would be fine, thank you,


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-24 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1WRbSg-00088X-MH@vcs.savannah.gnu.org>
2014-03-24  1:43 ` [Emacs-diffs] emacs-24 r116836: Fix keyword argument parsing. Please bootstrap Stefan
2014-03-24  2:39   ` Daniel Colascione
2014-03-24  2:58     ` Daniel Colascione
2014-03-24 13:12       ` Stefan

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.