in reply to Re^2: shell vs. filehandler
in thread shell vs. filehandler
Hi. Due to the small number of instructions executed, both scripts are too small for a trustable benchmark.
real measures how much time the program took to execute, user how much time took in user mode, and sys, how much in kernel mode.
Notice that your system may be busy, so there may be many processes changing their context.
This (which is part of the so called system entropy) may vary in a very short time, and as your scripts runs also for a very short period of time, entropy may affect them in different ways.
This may cause the fastest script to appear as the lowest.
Try to rewrite them opening a reasonable ammount of files, so you can compare times of execution more accurately.