Performance enhancements:
1. Changed DRAGON4-FIXUP to use fast scaling similar to described in
Burger and Dybvig (reference in file). This makes an order of
magnitude difference for unparsing flonums with large exponents.
2. Changed DRAGON4 to pass exponent to DRAGON4-FIXUP for scaling
estimate.
3. Systematically replaced calls to generic operators with calls to
int: variants (and rat:expt). The vast majority of operations are
on bignums. Gives a gain of about 20%.
Timings (Non-GC runtime) in msec for 1000 calls on 200Mhz Pentium Pro.
Example Number Original Fast Scaling and INT:ops
3.
141592653589793 840 820 580
1022. 320 300 230
1.
234e300 4870 490 400
1.23456e-300 7130 680 540
It is still pretty sad that you can format only a few thousand numbers
per second.
PC-sampling shows that most of the time is spent as follows:
(27% primitive 253 "INTEGER-MULTIPLY")
(24% primitive 200 "GARBAGE-COLLECT")
(24% primitive 248 "INTEGER-DIVIDE")
(5%. primitive 260 "INTEGER-SUBTRACT")