[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Also optimize case-lambda using rest-cdr mechanism (#1623)
From: |
Peter Bex |
Subject: |
[PATCH] Also optimize case-lambda using rest-cdr mechanism (#1623) |
Date: |
Thu, 21 Nov 2019 17:16:29 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Hi all,
I had a quick look at improving case-lambda handling, and to my surprise
that was very easy to do. All the rest-cdr tracking is already in place,
and case-lambda basically expands to a rest lambda which dispatches on
the length of the rest arg and then picks it apart. The arguments
themselves are already handled correctly by ##core#rest-car, so the only
thing that was getting in the way of optimizing away the consing of the
rest list was the (length rest-list) call at the top!
The attached patch simply adds another core form ##core#rest-length which
is optimized away to check the "c" argument in the C code which indicates
the length of the argvector instead of taking the length of the rest list
variable.
Cheers,
Peter
0001-Add-new-core-rest-length-form-which-speeds-up-case-l.patch
Description: Text Data
signature.asc
Description: PGP signature
- [PATCH] Also optimize case-lambda using rest-cdr mechanism (#1623),
Peter Bex <=