+0.3 microsecond delay for iterating empty vectors

Discussion in 'C Programming' started by krbyxtrm, May 25, 2006.

  1. krbyxtrm

    krbyxtrm Guest

    hello

    i have this profile for iterating empty vectors:
    +0.3us (microsecond) delay on intel pentium 2.4Ghz
    can this added delay to my application be reduced? i mean near zero
    delay, its very important.

    BTW, does anyone has another profile for this? thanks.
     
    krbyxtrm, May 25, 2006
    #1
    1. Advertising

  2. "krbyxtrm" <> writes:
    > i have this profile for iterating empty vectors:
    > +0.3us (microsecond) delay on intel pentium 2.4Ghz
    > can this added delay to my application be reduced? i mean near zero
    > delay, its very important.
    >
    > BTW, does anyone has another profile for this? thanks.


    It's not at all clear what you're talking about. What do you mean by
    "vector"? If you're referring to a "vector" as defined in the C++
    standard library, you're in the wrong place; comp.lang.c++ is down the
    hall, just past the water cooler, first door on the left.

    If not, you're going to have to be more specific about what "iterating
    empty vectors" means. A code sample (preferably a small and
    self-contained one) would be helpful.

    But keep in mind that the C standard says nothing about code
    performance. It specifies what your program does, not how fast it
    does it.

    If you can show us a small complete program that depends only on
    features defined by standard C, we might be able to offer some hints
    on how to write it to be more efficient, but there are no guarantees.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, May 25, 2006
    #2
    1. Advertising

  3. krbyxtrm

    pete Guest

    Keith Thompson wrote:
    >
    > "krbyxtrm" <> writes:
    > > i have this profile for iterating empty vectors:
    > > +0.3us (microsecond) delay on intel pentium 2.4Ghz
    > > can this added delay to my application be reduced? i mean near zero
    > > delay, its very important.
    > >
    > > BTW, does anyone has another profile for this? thanks.

    >
    > It's not at all clear what you're talking about.
    > What do you mean by "vector"?


    I don't even know what he means by "profile".
    It seems to be some kind of added delay.

    --
    pete
     
    pete, May 25, 2006
    #3
  4. krbyxtrm

    krbyxtrm Guest

    Ayon kay pete:
    > Keith Thompson wrote:
    > >
    > > "krbyxtrm" <> writes:
    > > > i have this profile for iterating empty vectors:
    > > > +0.3us (microsecond) delay on intel pentium 2.4Ghz
    > > > can this added delay to my application be reduced? i mean near zero
    > > > delay, its very important.
    > > >
    > > > BTW, does anyone has another profile for this? thanks.

    > >
    > > It's not at all clear what you're talking about.
    > > What do you mean by "vector"?

    >
    > I don't even know what he means by "profile".
    > It seems to be some kind of added delay.
    >
    > --
    > pete

    that was to profile the function. how much time spent.
     
    krbyxtrm, May 26, 2006
    #4
  5. "krbyxtrm" <> writes:
    > Ayon kay pete:
    >> Keith Thompson wrote:
    >> > "krbyxtrm" <> writes:
    >> > > i have this profile for iterating empty vectors:
    >> > > +0.3us (microsecond) delay on intel pentium 2.4Ghz
    >> > > can this added delay to my application be reduced? i mean near zero
    >> > > delay, its very important.
    >> > >
    >> > > BTW, does anyone has another profile for this? thanks.
    >> >
    >> > It's not at all clear what you're talking about.
    >> > What do you mean by "vector"?

    >>
    >> I don't even know what he means by "profile".
    >> It seems to be some kind of added delay.
    >>

    > that was to profile the function. how much time spent.


    So when you ask "does anyone has another profile for this?", you're
    actually asking if anyone else has measured the time spent by this
    function that you haven't actually told us about. Is that correct?

    You haven't given us enough information for us to even begin to answer
    your question. I suspect we wouldn't be able to help you even if we
    understood what you're talking about, but we certainly can't with what
    you've given us so far.

    What exactly is a "vector"? What are you doing to iterate an empty
    vector? Can you show us some actual C code that illustrates the
    problem? Or do you expect us to be mind readers?

    Have you read <http://www.catb.org/~esr/faqs/smart-questions.html>?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, May 26, 2006
    #5
  6. krbyxtrm

    pete Guest

    Keith Thompson wrote:
    >
    > "krbyxtrm" <> writes:
    > > Ayon kay pete:
    > >> Keith Thompson wrote:
    > >> > "krbyxtrm" <> writes:
    > >> > > i have this profile for iterating empty vectors:
    > >> > > +0.3us (microsecond) delay on intel pentium 2.4Ghz
    > >> > > can this added delay to my application be reduced?
    > >> > > i mean near zero delay, its very important.
    > >> > >
    > >> > > BTW, does anyone has another profile for this? thanks.
    > >> >
    > >> > It's not at all clear what you're talking about.
    > >> > What do you mean by "vector"?
    > >>
    > >> I don't even know what he means by "profile".
    > >> It seems to be some kind of added delay.
    > >>

    > > that was to profile the function. how much time spent.

    >
    > So when you ask "does anyone has another profile for this?", you're
    > actually asking if anyone else has measured the time spent by this
    > function that you haven't actually told us about. Is that correct?
    >
    > You haven't given us enough information for us to even begin to answer
    > your question. I suspect we wouldn't be able to help you even if we
    > understood what you're talking about, but we certainly can't with what
    > you've given us so far.
    >
    > What exactly is a "vector"? What are you doing to iterate an empty
    > vector? Can you show us some actual C code that illustrates the
    > problem? Or do you expect us to be mind readers?


    I thought he meant that his profiler was
    screwing up a real time program, by adding a delay to it.

    And this repsonse
    "that was to profile the function. how much time spent."
    doesn't really clear that up.

    The time that it takes to do something,
    isn't, to me, an "added" delay,
    unless it's something that doesn't need to be done.

    --
    pete
     
    pete, May 26, 2006
    #6
  7. krbyxtrm

    krbyxtrm Guest

    sorry again for not being too clear, bec. i though i was off topic here
    then,
    but anyway, here's it:

    i have implemented my code this way

    start = read_timer(); // for profiling
    if ( !any_vec.empty() )
    {

    std::for_each(
    any_vec.begin(),
    any_vec.end(),
    retrieve); // where retrieve is an empty function for
    now...

    }
    end = read_timer();
    duration = end - start ; // minus counter error

    with this code and having empty callback function,
    it duration = 1.2e-1 us (0.12us) for a vector with one item,
    0.3us delay before bec. i did not use '!any_vec.size()',
    this is solution i made just now... but still i need more perpormance.
    ;-)

    other people from other groups tells that is should see std::vector
    documentation
    to see whether i'm using a debug-enable vector library, and if that is
    so that is causing such delay.

    -k-
     
    krbyxtrm, May 26, 2006
    #7
  8. "krbyxtrm" <> writes:
    > sorry again for not being too clear, bec. i though i was off topic here
    > then,
    > but anyway, here's it:
    >
    > i have implemented my code this way
    >
    > start = read_timer(); // for profiling
    > if ( !any_vec.empty() )
    > {
    >
    > std::for_each(
    > any_vec.begin(),
    > any_vec.end(),
    > retrieve); // where retrieve is an empty function for


    BZZZT!

    That's C++, not C. Ask in comp.lang.c++. We can't help you here.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, May 26, 2006
    #8
  9. krbyxtrm

    pete Guest

    [ot]Re: +0.3 microsecond delay for iterating empty vectors

    krbyxtrm wrote:
    >
    > sorry again for not being too clear,
    > bec. i though i was off topic here


    Yeah--ah--let me have a Three Musketeers bar, ah,
    and a ball point pen there, a comb,
    a pint of Old Harper, some off topic advice,
    a couple of flashlight batteries and
    some of this beef jerky.

    http://www.weeklyscript.com/American Graffiti.txt

    --
    pete
     
    pete, May 26, 2006
    #9
  10. krbyxtrm

    krbyxtrm Guest

    I did apologized for being off topic here, but then...
    ---
    Some people are really rude on what they say.
    -k-
     
    krbyxtrm, May 29, 2006
    #10
    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. krbyxtrm
    Replies:
    25
    Views:
    685
    scott urban
    Sep 16, 2006
  2. Replies:
    3
    Views:
    709
    Shadowman
    Mar 26, 2008
  3. carl
    Replies:
    5
    Views:
    2,430
    James Kanze
    Nov 25, 2009
  4. Guest
    Replies:
    0
    Views:
    461
    Guest
    Sep 14, 2005
  5. Dmitry Maksyoma
    Replies:
    0
    Views:
    99
    Dmitry Maksyoma
    May 17, 2006
Loading...

Share This Page