fork download
  1. #!/bin/bash
  2.  
  3. # ls -l /etc/ revealed a file /etc/matplotlibrc which is currently 32235 bytes
  4.  
  5. echo "(see stderr tab for actual results)"
  6.  
  7. # make sure the file is cached before the experiment
  8. cat /etc/matplotlibrc >/dev/null
  9.  
  10. echo "*** with cat" >&2
  11. time bash -c 'for n in {1..1000}; do cat /etc/matplotlibrc | wc -l; done >/dev/null'
  12.  
  13. echo "*** without cat" >&2
  14. time bash -c 'for n in {1..1000}; do wc -l </etc/matplotlibrc; done >/dev/null'
  15.  
Success #stdin #stdout #stderr 0.16s 4480KB
stdin
Standard input is empty
stdout
(see stderr tab for actual results)
stderr
*** with cat

real	0m0.787s
user	0m0.016s
sys	0m0.080s
*** without cat

real	0m0.383s
user	0m0.024s
sys	0m0.032s