[Haskell-cafe] haskell in online contests

vishnu pathsny at gmail.com
Sat Nov 28 15:21:20 EST 2009


this is where I've gotten to.
http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=5120#a5120
strangely enough Ive gotten no speedup at all from the substitution cost
UArray (though I had to make it Int, Int to deal with digits.). But still I
wonder if there's something else I missed. Im really curious what lazyness
you used to go from 60 to 1.6? I always thought lazyness was automatic and
seq made strictness possible.
thanks
Vishnu

On Sat, Nov 28, 2009 at 7:41 AM, Daniel Fischer <daniel.is.fischer at web.de>wrote:

> Am Samstag 28 November 2009 02:04:31 schrieb Daniel Fischer:
> > Make it
> >
> > distance orig new = f m n
> >
> > and no thunks need be written at all in this case.
> > Cuts down running time by nearly half :)
> >
> > I think you could speed it up significantly by calculating the distance
> > more lazily.
>
> Yup :D
>
> Timings here:
> Your last ByteString code: 128s
> That with corrected index calculation: 172s
> Correct indices and distance orig new = f m n instead of memf m n: 99s
> That and an array for the substitution cost: 64s
>
> String IO, substitution cost array and a suitably lazy break-early distance
> function: 1.7s
> That and a lazier surcharge function: 1.5s
> The same with ByteString IO: 1.4s
>
> Yes, I'd say that qualifies as a significant speedup.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091128/8ec6ca75/attachment.html


More information about the Haskell-Cafe mailing list