in reply to How to find out, why my perl code is slow.

Can you please tell us what you mean exactly by slow? Or, in other words, how many bytes (or megabytes, whatever) you're processing per unit of time? And, if possible, how much faster your would expect tor want) it to be?

For finding the slow parts in your program, the best is probably to use a profiling tool such as Devel::NYTProf.

Otherwise, as a general comment, I would suspect that using the regex engine in a loop to fetch one byte at a time is probably quite inefficient. unpack is very likely to be significantly faster if you can use it. Even substr in a loop is quite probably going to run faster.

  • Comment on Re: How to find out, why my perl code is slow.

Replies are listed 'Best First'.
Re^2: How to find out, why my perl code is slow.
by Anonymous Monk on Nov 05, 2018 at 06:04 UTC

    An file has a size of about 420 kbytes, so about 55000 to 65000 data sets. Processing (Decoding) one Files takes in average 1.75 seconds (without data post processing). Usually at one step between 50 (~1:27) and 400 files (~11:37) are processed. It would be nice to be with 400 files clear below one minute.<\p>

    I will have a look to MDevel::NYTProf ......<\p>