CW 351

B. Demoen, P.-L. Nguyen
What if [a] really equals .(a,[]) ?


The WAM traditionally optimizes for lists in two ways: by a list-specialized instruction set (LSIS) and by a list-specialized data representation (LSDR). These are partly orthogonal and their relative merit is unknown. In this paper, we perform an experiment within hProlog, which compares the schemas (LSIS+LSDR), (LSIS) and (). If no LSDR is used, it means that lists are treated as the syntactic sugar they stand for: terms with principal functor ./2. By not using LSDR, the implementation becomes more uniform and thereby invites more generally applicable optimizations. This leads to almost no performance loss, except in a couple of artificial benchmarks. Anyone attempting to just implement Prolog form scratch, should seriously consider not using LSDR. LSIS was found to be less effective than anticipated.

report.pdf / mailto: B. Demoen