<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
There shouldn't be any difference. AFAIK, Float is a synonym for Flonum.<br></blockquote><div><br></div><div>I think the odd timing results that I got (with Real/Flonum the same and Float faster) was actually a result of other changes that I was making as I went. Float/Flonum being the same thing is a bit strange at times, since the errors don't seem particularly consistent on which they use (I expect it's whichever one was used in the particular type declaration I'm breaking and those vary). </div>
<div><br></div><div style>In case anyone is interested in the final timing here are all of the steps (running from command line Racket rather than DrRacket). I'll write up a better blog post detailing the process and the steps along the way probably this weekend.</div>
<div><br></div><div><b>Untyped code, generating an image, git: b2d12e4</b></div><div><span style="font-family:'courier new',monospace"> perlin: cpu time: 355 real time: 356 gc time: 40</span><br></div><div><div><font face="courier new, monospace">simplex: cpu time: 243 real time: 242 gc time: 4</font></div>
</div><div><br></div><div><b>Typed code with Real, no wrapper, generating an image, git: 006faf9</b></div><div><div><font face="courier new, monospace"> perlin: cpu time: 235 real time: 236 gc time: 15</font></div><div><font face="courier new, monospace">simplex: cpu time: 147 real time: 147 gc time: 4</font></div>
</div><div><br></div><div><b>Typed code with Float, wrapper converting Real to Float, generating an image, git: 5da0723</b></div>
<div><span style="font-family:'courier new',monospace"> perlin: cpu time: 112 real time: 118 gc time: 23</span><br></div><div><div><font face="courier new, monospace">simplex: cpu time: 106 real time: 110 gc time: 3</font></div>
<div><br></div><div>Originally I was confused because building the images was actually faster than just using the data directly. But then I realized that timing-tests.rkt wasn't Typed. It's kind of amazing how much that helps... Now I'm seeing about 50-60ms of overhead just to create the image which you had mentioned as well.</div>
</div><div><br></div><div><div style><b>Typed code with Float, wrapper, not generating an image, git: 7445311</b></div><div><font face="courier new, monospace"> perlin: cpu time: 41 real time: 40 gc time: 0</font></div><div>
<font face="courier new, monospace">simplex: cpu time: 52 real time: 52 gc time: 2</font></div></div><div><br></div><div style>I'm not sure how much better even <i>could</i> be done at this point. Particularly since the original code that mine is based on--In Java, not C. Oops--runs a 256x256 without making an image in ~30ms. So we're definitely in the same ballpark now.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Racket macros and languages don't generally distinguish paren shapes. (It's hard to preserve that syntax property as macros expand.) IOW, this works because `[...]' isn't special:<br>
<br>
(: build-perlin-image (Integer Integer (#:scale Real) -> flomap))<br></blockquote><div><br></div><div>Right. I was still hoping that would be how to signify optional parameters. Although that wouldn't work since the same sort of shape is used for signifying Listof/Vectorof/etc. I'm unsure if there's anything that is the only item in a list though.</div>
</div></div></div>