Peter Bex scripsit: > Of course, Guile is "cheating" by using GMP. If I compare it to another > Scheme which has its own bignum implementation like Gauche, we perform > about the same. It's interesting that sbcl is doing so well. Maybe I'm > overlooking something seemingly minor but important?
Here's a remark from the SBLC ideas page that may be helpful: Integer division is notorious for being slow. However, it is also known that the divisor is constant in the vast majority of cases, and serious compilers exploit that fact to simplify divisions into sequences of simpler multiplications, shifts, and additions. SBCL implements such a simplification only for truncated division of unsigned machine words. Floor and ceiling are less commonly supported natively in programming languages, and there is a dearth of literature describing how to simplify them. However, it is possible to do so, for both signed and unsigned machine integers. It is also possible to specialise the routines for tagged arithmetic. A complete execution of this project would include the development of simplification routines for signed and unsigned truncate, floor and ceiling divisions by integer constants. Some of the simplifications, particularly those concerning tagged integers, will be widely applicable and likely novel. _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
