given the allocation rate, I'm willing to bet that you are doing exact arithmetic. Once you realize that each division turns into rationals of bignums, you begin to see that "exact" isn't all its cracked up to be. As Brad suggested, you should either use explicit flonum operators, or judiciously inject exact->inexact conversions into your code.
- d
On 23 April 2013 15:22, Bradley Lucier lucier@math.purdue.edu wrote:
On Apr 23, 2013, at 9:50 AM, Zhen Shen wrote:
Besides tail-calls, what else can i do to reduce GC?
You know, it's really hard to say without seeing your code.
You say your code is a numerical algorithm.
Are you using generic arithmetic rather than floating-point specific operators? Are you mixing integers and floating-point numbers in arithmetic operations? Do you have loops with flonums as arguments? Do you try to save time by precomputing flonums before if statements rather than recomputing the expressions? Do you use / rather than quotient, generating rational numbers?
All those things could cause numbers to be boxed rather than used inline.
Brad
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list