Skip to main content
2 of 2
code escapes
HalosGhost
  • 4.9k
  • 10
  • 38
  • 42

One downside of printf is performance because the built-in shell echo is much faster. This comes into play particularly in Cygwin where each instance of a new command causes heavy Windows overhead. When I changed my echo-heavy program from using /bin/echo to the shell's echo the performance almost doubled. It's a trade off between portability and performance. It's not a slam dunk to always use printf.

John
  • 71
  • 1
  • 1