help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] help on an executable performance


From: Greg Wooledge
Subject: Re: [Help-bash] help on an executable performance
Date: Thu, 13 Aug 2015 09:13:51 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Aug 13, 2015 at 04:39:02PM +0800, ?????? wrote:
>     I run a executable file within a bash shell prompt:
>     address@hidden:~$ ./executable_file

Is it a bash script?

>     Generally, it will run about 5 seconds, and print a line of word such as 
> "it take 5s" (clock_gettime is used to measure the running time in the 
> executable_file)
> 
> 
>     if i redirect the output to a file like tmp.txt:     address@hidden:~$ 
> ./executable_file > tmp.txt
>     it will run about 7 seconds.
> 
> 
>     i don't know why the performance drop so dramatically with redirection. 
>    Could you help to give some advices?

The redirection is not the cause of this variance in the execution time,
unless you are doing this in a directory that is on a file system with
extremely slow performance (e.g. a wide area network remotely mounted
file system).

This is not a bash question at all, unless the program is a bash script,
in which case you would have to show it for us to make any comments
about it.

Just because you run a thing from bash doesn't make it a bash question.

If you want to benchmark the performance of this program, run it 100 times
and collect statistics (average, min, max, standard deviation, etc.).
Do this with and without redirection.  I believe you will find that
the redirection is not relevant.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]