in reply to Re: Recommendations for perl modules to work on data sets ?
in thread Recommendations for perl modules to work on data sets ?

@tybalt89, thank you for showing me the cool code.

I got a question though, isn't it true that REGEX's are slow when you are dealing with large amounts of data ?

Thanks!
  • Comment on Re^2: Recommendations for perl modules to work on data sets ?

Replies are listed 'Best First'.
Re^3: Recommendations for perl modules to work on data sets ?
by Laurent_R (Canon) on Oct 21, 2016 at 21:17 UTC
    Premature optimization is the root of all evil (or at least most of it) in programming. (Donald Knuth)

    In general, if a regex is the right tool to solve your problem, then use a regex. Try to change it so something else afterwards, only if you've found that it is too slow. But don't make it more complicated than it needs to be if you don't have to.

    Well, having said that, I should add that there are some exceptions: sometimes it is good to think about a fast algorithm or a more efficient data structure before you start coding, but that usually does not apply to micro-optimizations and small efficiencies such as regexes versus other solutions (such as substr, index or unpack).

Re^3: Recommendations for perl modules to work on data sets ?
by tybalt89 (Monsignor) on Oct 21, 2016 at 20:25 UTC

    Only benchmarking can answer that question. See Benchmark.pm