[Haskell-cafe] Haskell performance when it comes to regex?

Bram Neijt bneijt at gmail.com
Tue May 16 09:12:54 UTC 2017


Dear reader,

I decided to do a little project which is a simple search and replace
program for large text files.

Written in Haskell, it does a few different regex matches on each line
and stores them in a leveldb key-value store to create a
consistent/reviewable search-replace index. It should provide for some
simple/brute-force anonymization of data and therefore I called it
hanon (sorry, could not think of a better name).

https://github.com/BigDataRepublic/hanon

The code works, but I've done some benchmarking to compare it with
Python and the code is about 80x slower then doing the same thing in
Python, making it useless for larger data files.

I'm obviously doing something wrong.

Could you give me tips on improving the performance of this code?
Probably mainly looking at

https://github.com/BigDataRepublic/hanon/blob/master/src/Mapper.hs

where the regex code lives?

Greetings,

Bram


More information about the Haskell-Cafe mailing list