length of module name affecting performance??

Daniel Gorín dgorin at dc.uba.ar
Mon Dec 15 16:10:29 EST 2008


Hi

While trying to see if I could make some code run faster I stumbled  
upon something that looks weird to me: 2x-3x performance loss when a  
module is renamed to a longer name!

Here's what I see with the attached examples:

#diff long-modname-ver.hs short-modname-ver.hs
2c2
< import VeryLongModuleName
---
 > import ShortM

#diff VeryLongModuleName.hs ShortM.hs
1c1
< module VeryLongModuleName
---
 > module ShortM

#ghc --make -O2 -Wall long-modname-ver.hs

#ghc --make -O2 -Wall short-modname-ver.hs

#time -p ./long-modname-ver > /dev/null
real 55.90
user 55.17
sys 0.51

#time -p ./short-modname-ver > /dev/null
real 22.23
user 21.97
sys 0.10

I'm using GHC 6.10.1 on OS X. Any ideas on what may be going on?

Thanks
Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: files.tgz
Type: application/octet-stream
Size: 5330 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20081215/24727ee0/files-0001.obj
-------------- next part --------------



More information about the Glasgow-haskell-users mailing list