[gambit-list] decreasing GC

Zhen Shen zhenshen10 at outlook.com
Wed Apr 24 12:37:18 EDT 2013







Havens!! Do gambit users launch rockets into space, is that the reason for having bignum arithmetic by default??!

Oh, and speaking of "exact" arithmetic, I thought that was impossible cause digital computers cant store reals?

Anyhow, thanks to your and brad's suggestions, I made significant improvements:
memory usage is 3GB (down from 18GB!) and execution time descreased by 80%. This is mostly due to the flonums.

Now, doing (declare (flonum)) at the top level, does this stop gambit from boxing flonums across function calls?



> Date: Tue, 23 Apr 2013 22:47:11 +0100
> Subject: Re: [gambit-list] decreasing GC
> From: kumoyuki at gmail.com
> To: lucier at math.purdue.edu
> CC: zhenshen10 at outlook.com; gambit-list at iro.umontreal.ca
> 
> 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 at 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 at iro.umontreal.ca
> > https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
> 
> 
> 
> -- 
> GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130424/22f8552d/attachment.htm>


More information about the Gambit-list mailing list