in reply to Re^3: looping efficiency (Benchmark Example)
in thread looping efficiency

None of the methods shown will have more than a negligible impact compared to creating/accessing those files.

Harddisks are extremely slow compared to CPU and RAM.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^5: looping efficiency
by eyepopslikeamosquito (Archbishop) on Dec 30, 2020 at 03:36 UTC

    Oh I totally agree! I was shocked they would argue about efficiency without first benchmarking the whole program and identifying that code as a chronic bottleneck! (I only did the benchmark because I was bored and curious on a slow Christmas/New Year holiday).

    On Coding Standards and Code Reviews summarises my opinion:

    • Correctness, simplicity and clarity come first. Avoid unnecessary cleverness. If you must rely on cleverness, encapsulate and comment it.
    • Don't optimize prematurely. Benchmark before you optimize. Comment why you are optimizing.

    For much more detail on this topic see: