<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>


<div dir="ltr">

<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">Havens!! Do gambit users launch rockets into space, is that the reason for having bignum arithmetic by default??!<br><br>Oh, and speaking of "exact" arithmetic, I thought that was impossible cause digital computers cant store reals?<br><br>Anyhow, thanks to your and brad's suggestions, I made significant improvements:<br>memory usage is 3GB (down from 18GB!) and execution time descreased by 80%. This is mostly due to the flonums.<br><br>Now, doing (declare (flonum)) at the top level, does this stop gambit from boxing flonums across function calls?<br><br><br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Tue, 23 Apr 2013 22:47:11 +0100<br>> Subject: Re: [gambit-list] decreasing GC<br>> From: kumoyuki@gmail.com<br>> To: lucier@math.purdue.edu<br>> CC: zhenshen10@outlook.com; gambit-list@iro.umontreal.ca<br>> <br>> given the allocation rate, I'm willing to bet that you are doing exact<br>> arithmetic. Once you realize that each division turns into rationals<br>> of bignums, you begin to see that "exact" isn't all its cracked up to<br>> be. As Brad suggested, you should either use explicit flonum<br>> operators, or judiciously inject exact->inexact conversions into your<br>> code.<br>> <br>> - d<br>> <br>> On 23 April 2013 15:22, Bradley Lucier <lucier@math.purdue.edu> wrote:<br>> ><br>> > On Apr 23, 2013, at 9:50 AM, Zhen Shen wrote:<br>> ><br>> >> Besides tail-calls, what else can i do to reduce GC?<br>> ><br>> > You know, it's really hard to say without seeing your code.<br>> ><br>> > You say your code is a numerical algorithm.<br>> ><br>> > 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?<br>> ><br>> > All those things could cause numbers to be boxed rather than used inline.<br>> ><br>> > Brad<br>> ><br>> > _______________________________________________<br>> > Gambit-list mailing list<br>> > Gambit-list@iro.umontreal.ca<br>> > https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list<br>> <br>> <br>> <br>> -- <br>> GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt<br></div></div>
</div>
                                          </div></body>
</html>