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

2008-07-23 Thread Luke Palmer
On Wed, Jul 23, 2008 at 6:10 PM, Corey O'Connor <[EMAIL PROTECTED]> wrote: > My straightforward Haskell solution was: > --- > import Text.Regex.Posix > > main = do >f_lines <- readFile "test.out" >>= return . lines >let duratio

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

2008-07-23 Thread Don Stewart
brad.larsen: > And against gawk 3.1.5: > > $ time awk -F: '{sum += 1 / $2} END{print sum}' test.out > 3155.63 > > real0m0.197s > user0m0.184s > sys 0m0.004s > > compared to Don's Haskell version: > > $ time ./fastSum < test.out > 3155.62664377 > > real0m0.072s > user0m0

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

2008-07-23 Thread Corey O'Connor
On Wed, Jul 23, 2008 at 2:23 PM, Justin Bailey <[EMAIL PROTECTED]> wrote: > On Wed, Jul 23, 2008 at 11:10 AM, Corey O'Connor <[EMAIL PROTECTED]> 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

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

2008-07-23 Thread Brad Larsen
And against gawk 3.1.5: $ time awk -F: '{sum += 1 / $2} END{print sum}' test.out 3155.63 real0m0.197s user0m0.184s sys 0m0.004s compared to Don's Haskell version: $ time ./fastSum < test.out 3155.62664377 real0m0.072s user0m0.056s sys 0m0.004s compared to the Corey

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

2008-07-23 Thread Justin Bailey
On Wed, Jul 23, 2008 at 11:10 AM, Corey O'Connor <[EMAIL PROTECTED]> 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 w

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

2008-07-23 Thread Don Stewart
coreyoconnor: > I have the need to regularly write tiny programs that analyze output > logs. The output logs don't have a consistent formatting so I > typically choose Perl for these tasks. > > The latest instance of having to write such a program was simple > enough I figured I'd try my hand at u

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

2008-07-23 Thread Corey O'Connor
Sounds great! Thanks for the advice. :-) -Corey On Wed, Jul 23, 2008 at 1:18 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > coreyoconnor: >> I have the need to regularly write tiny programs that analyze output >> logs. The output logs don't have a consistent formatting so I >> typically choose Perl

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

2008-07-23 Thread Don Stewart
coreyoconnor: > I have the need to regularly write tiny programs that analyze output > logs. The output logs don't have a consistent formatting so I > typically choose Perl for these tasks. > > The latest instance of having to write such a program was simple > enough I figured I'd try my hand at u

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

2008-07-23 Thread Corey O'Connor
I have the need to regularly write tiny programs that analyze output logs. The output logs don't have a consistent formatting so I typically choose Perl for these tasks. The latest instance of having to write such a program was simple enough I figured I'd try my hand at using Haskell instead. The