[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: union, intersection etc. cons too much with &key arguments
- To: <clisp-list@ma2s2.mathematik.uni-karlsruhe.de>
- Subject: Re: union, intersection etc. cons too much with &key arguments
- From: Bruno Haible <haible@ilog.fr>
- Date: Fri, 5 Sep 1997 15:26:24 +0200 (MET DST)
- >received: from halles.ilog.fr (halles.ilog.fr [172.16.1.96]) by ilog.ilog.fr (8.8.7/8.7.3) with ESMTP id PAA24986; Fri, 5 Sep 1997 15:26:28 +0200 (MET DST)
- In-reply-to: <199709011150.AA06828@zeus.gmd.de>
- References: <199709011150.AA06828@zeus.gmd.de>
Jörg-Cyril Höhle <hoehle@zeus.gmd.de> noticed:
> > (time (intersection '(1 2 3 4 5 6 7 8 9) '(a b c d e f g h i j k l) :test #'eql :key #'identity))
>
> Real time: 0.0 sec.
> Run time: 0.0 sec.
> Space: 608 Bytes
> ...
>
> Instead of
> if (flags & bit(0)) { NEXT(ptr1) = unbound; } # Rest-Parameter
> there could be a loop similar to apply_cclosure_rest_nokey: where only
> <args_on_stack> values need be pushed onto <args>, constructing the &REST
> list in apply_closure() and not in match_cclosure_key().
The consing overhead of APPLYing a function with both &REST and &KEY will
be a little more optimized in the next version. Thanks for noticing this
opportunity for improvement.
Bruno