Hi Jon,

> I just noticed a surprisingly big difference in execution speed
> between 32- and 64-bit PicoLisp when doing divisions.

In general, arithmetics is much faster in pil64 than in pil32.

One reason is the more efficient implementation in assembly, where you
have direct access to the CPU flags like "sign" and "carry".

But more important is that pil32 must represent all numbers internally
as bignums (i.e. in cell structures), due to the restricted word length
and tag bits.

Pil64, on the other hand, represents short numbers (up to 60 bits plus
sign) directly in the tagged pointer. This has the advantage that
results of arithmetic operations won't cause cell allocation in the
heap, avoiding increased garbage collections.


> The first line sets P to (6402373705728000 18 17 16 15 14 13 12 11 10 9 8 7 6 
> 5 4 3 2).

The first number is still in the range of a short num. So the whole
computation takes place as short numbers in pil64.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to