0

This question is somewhat related to another one on AskUbuntu, where OP asked how to decide which command to use , sed or tail. So far, all the answers have focused on using either looping in bash or time for single-shot runs. What bothers me about looping approach is that it introduces bash's looping performance as overhead.

Are there ways to test commmand line utilities for performance without introducing shell's performance into the picture ? Are there ways other than time to test performance ? In general, what else can be used to test command-line utilities ?

closed as too broad by jayhendren, G-Man, slm Dec 21 '16 at 2:14

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Unroll the loop: make each iteration of the shell loop contain 100 explicitly coded iterations of the command. Whatever performance penalty the shell loop introduces will vanish into irrelevance. (Not to say that if the shell looping performance is important then your command is already plenty fast enough.) – AlexP Dec 20 '16 at 23:13
  • seems kind of broad. – Jasen Dec 21 '16 at 0:12
1

strace -c is certainly worth a look. man page :

Count time, calls, and errors for each system call and report a summary on program exit. On Linux, this attempts to show system time (CPU time spent running in the kernel) independent of wall clock time. If -c is used with -f or -F (below), only aggregate totals for all traced processes are kept.

Not the answer you're looking for? Browse other questions tagged or ask your own question.