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?