[Haskell-cafe] More fun with micro-benchmarks and optimizations. (GHC vs Perl)

Justin Bailey jgbailey at gmail.com
Wed Jul 23 15:23:48 EDT 2008


On Wed, Jul 23, 2008 at 11:10 AM, Corey O'Connor <coreyoconnor at gmail.com> wrote:
> I still have two questions after all this:
>  - Can I get a Haskell implementation as fast as the Perl?
>  - What do I need to do to get GHC's profiler to provide me usable
> information? Telling me that 98% of the time was in "main" is not very
> enlightening ;-)

Don did a great job answering teh first question. To get better
profiling information, add "SCC" annotations to your code. That will
tell you how much time is spent in a particular expression. For your
main function, take a divide and conquer approach - add SCCs to
determine what is taking the most time.

Take Don's advice first though before benchmarking - you probably
won't care after switching to bytestring & a better regex engine.

Justin


More information about the Haskell-Cafe mailing list