[plt-scheme] this code runs slower with modules?

From: John Clements (clements at brinckerhoff.org)
Date: Tue Dec 12 17:50:09 EST 2006

On Dec 12, 2006, at 12:08 PM, Eli Barzilay wrote:

> On Dec 12, John Clements wrote:
>> My understanding is that--for the vast majority of mzscheme
>> programs-- putting things in a module makes them faster, because
>> non-mutated module-level bindings do not need to be boxed.
>> However, for the attached code, uncommenting the first and last
>> lines--that is, wrapping them in a module--makes them run about 20%
>> _slower_. Are there known circumstances in which wrapping things in
>> modules makes them slower?
> I get faster performance with the unit version:
>   winooski:/ssh/ccs/tmp eli> mzscheme -tmv x.ss
>   placements per second: 3454.231433506045
>   placements per second: 3840.2457757296465
>   placements per second: 3477.0514603616134
>   winooski:/ssh/ccs/tmp eli> mzscheme -fmv x.ss
>   placements per second: 2336.9946249123627
>   placements per second: 2497.5024975024976
>   placements per second: 2169.6680407897593

Interesting.  Well, I tried this on my intel mac laptop and observed  
the same thing you did.  I guess that the PPC (the first machine was  
a G5) version of mzscheme is a funny animal.  Perhaps we don't do  
good code generation (there's some JIT stuff now, right?) for PPC.



(p.s.: for the first time in recorded history, my mac (intel laptop)  
has performance that's better than one of Eli's machines. Woo hoo!)

Posted on the users mailing list.