[Haskell-cafe] Sorting efficiency

David Feuer david.feuer at gmail.com
Sat Aug 4 17:23:05 CEST 2012


I'm writing a toy program (for a SPOJ problem--see
https://www.spoj.pl/problems/ABCDEF/ ) and the profiler says my
performance problem is that I'm spending too much time sorting. I'm
using Data.List.sort on [Int32] (it's a 32-bit architecture). Others,
using other languages, have managed to solve the problem within the
time limit using the same approach I've taken (I believe), but mine is
taking too long. Any suggestions? Do I need to do something insane
like sorting in an STUArray?

David Feuer



More information about the Haskell-Cafe mailing list