Re: system() peformance ..

Discussion in 'C++' started by Jack Klein, Jun 25, 2003.

  1. Jack Klein

    Jack Klein Guest

    On Wed, 25 Jun 2003 17:41:31 +0530, Paras Sharma <>
    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
    execute.

    > 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
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c /faq
     
    Jack Klein, Jun 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cy Huckaba
    Replies:
    1
    Views:
    1,175
    Xie Xiao
    Jun 26, 2003
  2. Simon Biber

    Re: system() peformance ..

    Simon Biber, Jun 26, 2003, in forum: C++
    Replies:
    0
    Views:
    737
    Simon Biber
    Jun 26, 2003
  3. Jack Klein

    Re: system() peformance ..

    Jack Klein, Jun 25, 2003, in forum: C Programming
    Replies:
    0
    Views:
    765
    Jack Klein
    Jun 25, 2003
  4. Simon Biber

    Re: system() peformance ..

    Simon Biber, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    731
    Simon Biber
    Jun 26, 2003
  5. =?ISO-8859-1?Q?Konrad_M=FChler?=

    Tool for Peformance Analysis of C++ code ...

    =?ISO-8859-1?Q?Konrad_M=FChler?=, Apr 26, 2007, in forum: C++
    Replies:
    2
    Views:
    386
    Zeppe
    Apr 26, 2007
Loading...

Share This Page