emacs-devel
[Top][All Lists]
Advanced

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

Re: [RFC] caar/cadr/cdar/cddr


From: Dmitry Antipov
Subject: Re: [RFC] caar/cadr/cdar/cddr
Date: Thu, 12 Jul 2012 21:44:04 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 07/12/2012 08:53 PM, Paul Eggert wrote:

How widely?  I've always been leery about those
functions, myself.

$ grep -nHR "(car (car (" lisp | wc -l
45
$ grep -nHR "(car (cdr (" lisp | wc -l
164
$ grep -nHR "(cdr (car (" lisp | wc -l
45
$ grep -nHR "(cdr (cdr (" lisp | wc -l
84

Since this is a performance
improvement, how much does performance improve?

Not yet because byte-opt.el should be able to optimize
(car (cdr X)) -> (cadr X) etc. Or, all Lisp sources
should be converted manually :-).

Quite possibly they're a win in the C implementation,
but I'm not sure they're worth adding bytecodes for.

Calling them via Funcall is too slow.

We might want to save bytecodes for something more
important.

Do we really runs out of bytecode range?

Assuming they're needed, I vote for a clean
implementation of Fcaar etc. rather than tricky
ones involving loops.  Especially since the tricky
loops are wrong and will infinite-loop in some
cases.

This Fcaar is 6 insns smaller than the obvious CAR (CAR (x))
implementation :-).

Dmitry



reply via email to

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