[Ecls-list] More about NIL

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Sat Mar 8 18:01:48 UTC 2008


Hi,

there is progress along the "new_cons" branch in our source code
repository. I have just committed a lot of changes which make NIL now
a fixed word (0x03). The code along that branch may be unstable, as
this change implies that:

1) NIL points to non-accessible memory. That means CAR/CDR have to be
coded differently, with NIL as special case.
2) NIL is no longer a symbol. This also implies special casing the
implementation of SYMBOL-VALUE, SYMBOL-PACKAGE, etc.

On the other hand, as you will notice below, this has a serious impact
on performance in OSX. The reason is that formerly code would have to
call a system function to find the location of the NIL object, while
now testing (NULL x) is just a byte comparison.

It is not recommented to check out the "new_cons" branch, as it is
subject to change about every hour :-)

Juanjo

;;; WITH NIL  = 0x03
Name         Real(s)    Run(s)    GC(kb)    Repetitions
ASSOC          2.017      2.01         4        1000000
RASSOC         1.851      1.84         4        1000000
NSUBST         .2937     .2927         4         100000
SUBST          1.146      1.14    156254         100000
LDIFF          .7017     .6982    154692         100000
BUTLAST-0      .6763     .6732    156254         100000
BUTLAST-1      .6745     .6712    154692         100000
BUTLAST-2      0.668     .6647    153129         100000
NBUTLAST-0     .2728     .2717         4        1000000
NBUTLAST-1     .0937     0.093     15629        1000000
NBUTLAST-2     0.236     .2347     31254        1000000
NCONC-2        .3048     0.299     15629        1000000
NCONC-3        .3967     .3895     31254        1000000
LIST*          .4848     .4795    156254        1000000
LIST           .4632      0.46    156254        1000000
APPEND         .3955     .3933    157817         100000
MAKE-LIST      .3938     .3917    156254         100000
COPY-LIST      .3842     0.382    156254         100000
COPY-ALIST     0.424     .4215    156254         100000
LAST-0         0.267     .2655         4        1000000
LAST-1         .2373     .2363         4        1000000
LAST-2         0.272     .2703         4        1000000

;;; WITHOUT THIS & OTHER IMPROVEMENTS
Name         Real(s)    Run(s)    GC(kb)    Repetitions
ASSOC          2.545     2.536         4        1000000
RASSOC         2.607     2.583         4        1000000
NSUBST         .3522     .3503         4         100000
SUBST          1.304     1.297    156254         100000
LDIFF          0.953     0.949    154692         100000
BUTLAST-0      .8212     .8178    156254         100000
BUTLAST-1      .8043     .8012    154692         100000
BUTLAST-2      .7903     0.784    153129         100000
NBUTLAST-0     .5048     .5018         4        1000000
NBUTLAST-1     .1238     0.123     15629        1000000
NBUTLAST-2     .2602     .2588     31254        1000000
NCONC-2        .4562     .4492     15629        1000000
NCONC-3         0.42     .4145     31254        1000000
LIST*          .5147     .5098    156254        1000000
LIST           .4937     .4902    156254        1000000
APPEND         .4515     .4463    156254         100000
MAKE-LIST      .3953     .3853    156254         100000
COPY-LIST      .4322     .4288    156254         100000
COPY-ALIST     0.453      0.45    156254         100000
LAST-0         .4137     .4113         4        1000000
LAST-1         .4182     .4097         4        1000000
LAST-2         .4182     .4088         4        1000000


-- 
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list