[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Faster tagged integer arithmetic
From: |
Ludovic Courtès |
Subject: |
Faster tagged integer arithmetic |
Date: |
Wed, 13 Oct 2010 01:21:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hello!
I’ve investigated tagged integer arithmetic and implemented an
optimization that makes ‘1+’ and ‘1-’ on fixnums almost twice as fast
(haven’t tried the rest yet):
- Before:
("arithmetic.bm: fixnum: 1+" 10000000 user 11.54 benchmark 10.2048559570312
bench/interp 10.2048559570312 gc 0.0)
("arithmetic.bm: fixnum: 1-" 10000000 user 11.51 benchmark 10.1748559570313
bench/interp 10.1748559570313 gc 0.0)
- After:
("arithmetic.bm: fixnum: 1+" 10000000 user 6.43 benchmark 5.09485595703125
bench/interp 5.09485595703125 gc 0.0)
("arithmetic.bm: fixnum: 1-" 10000000 user 6.44 benchmark 5.10485595703125
bench/interp 5.10485595703125 gc 0.0)
The idea is nicely described in “Representing Type Information in
Dynamically Typed Languages”, D. Gudeman, 1993,
<ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/typeinfo.ps.gz>.
Fun! :-)
Thanks,
Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Faster tagged integer arithmetic,
Ludovic Courtès <=