in reply to Re^7: Trying to optimize reading/writing of large text files.
in thread Trying to optimize reading/writing of large text files.

Great job on doing some benchmarks!
Benchmark is a core module (meaning that is included in all Perl installations without you having to install it yourself). This can simplify further benchmarking code.

I haven't looked in detail at your new code, but Version #1 made an in memory copy of the file. It is not surprising, and was expected that not doing that would save memory! With 100MB files, a 20% performance gain is also plausible (copying stuff around can be expensive).

Data recovery is something that we didn't talk about, but if it is even remotely possible that something "can go wrong", it will "eventually go wrong" if you do it enough times!

  • Comment on Re^8: Trying to optimize reading/writing of large text files.