Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: system() peformance ..

Thread Tools

Re: system() peformance ..

Jack Klein
Posts: n/a
On Wed, 25 Jun 2003 17:41:31 +0530, Paras Sharma <(E-Mail Removed)>
wrote in comp.lang.c:

> Hi
> I am running a cpp process say "ABC" which uses system() function .
> inside system running an one external binary say "xyz" (program ) ;

If by "cpp process" you mean a program written in C++, you are
off-topic posting in comp.lang.c at all.

> [This external program (xyz) takes some parameter do process & print
> some output.. meaning comsumes a bit of time . ]
> Now, my question is how to get the maximum rate

Neither C nor C++ have "maximum rates". Neither language defines,
specifies, or guarantees how long any particular code takes to

> 1 I tried giving system("xyz & " ) ; /////.. run external program in
> the background ; this will make return of system .

While the system() function is completely standard in C and C++, the
results are completely implementation-defined. That is both as to
what it does and how long it takes.

> Getting execution rate ~ 25 sec
> 2 I tried giving system("xyz " ) ; meaning .. run external program
> in the background ; this will make return of system .

Still implementation-defined.

> Getting execution rate ~ 14 sec
> 3 I tried running many instances of ABC .. now execution rate got
> decreased to ~15 per process

Neither C nor C++ have anything called a process.

> I tried using vfork , ..execl .. but some how system gives the better
> response and easy way out .. ..
> Main overservation is - System comsumes lot of time .. ( even running
> with root )

These terms are not defined in either C or C++: vfork, ..excel, root.

> Now My quiestion is ... how to increase the performace of the system()
> so that for different calling of system is fast ..
> Is it possibleto do such thing throught programming or configuration file

I imagine that the system() function call itself takes a few
microseconds, and it is unlikely that it can be speeded up much.

As for the execution time of whatever your operating system happens to
do with the string that you pass to it is not a language issue at all.

> Thanks in advance
> Paras

This is not a language issue at all. Ask in a group devoted to your
operating system. Perhaps news:comp.unix.programmer.

Jack Klein
Home: http://JK-Technology.Com
FAQs for
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool for Peformance Analysis of C++ code ... =?ISO-8859-1?Q?Konrad_M=FChler?= C++ 2 04-26-2007 02:52 PM
AspNet Process Memory Issue on Win2k Server - Peformance is fine - Memory usuage doesn't stop growing Cy Huckaba ASP .Net 1 06-26-2003 04:00 AM
Re: system() peformance .. Simon Biber C++ 0 06-26-2003 02:25 AM
Re: system() peformance .. Simon Biber C Programming 0 06-26-2003 02:25 AM
Re: system() peformance .. Jack Klein C Programming 0 06-25-2003 03:20 PM