471,089 Members | 1,140 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

+0.3 microsecond delay for iterating empty vectors

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.

May 25 '06 #1
9 2180
"krbyxtrm" <kr******@gmail.com> 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) ks***@mib.org <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.
May 25 '06 #2
Keith Thompson wrote:

"krbyxtrm" <kr******@gmail.com> 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
May 25 '06 #3

Ayon kay pete:
Keith Thompson wrote:

"krbyxtrm" <kr******@gmail.com> 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.

May 25 '06 #4
"krbyxtrm" <kr******@gmail.com> writes:
Ayon kay pete:
Keith Thompson wrote:
> "krbyxtrm" <kr******@gmail.com> 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) ks***@mib.org <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.
May 26 '06 #5
Keith Thompson wrote:

"krbyxtrm" <kr******@gmail.com> writes:
Ayon kay pete:
Keith Thompson wrote:
> "krbyxtrm" <kr******@gmail.com> 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
May 26 '06 #6
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-

May 26 '06 #7
"krbyxtrm" <kr******@gmail.com> 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) ks***@mib.org <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.
May 26 '06 #8
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%20Graffiti.txt

--
pete
May 26 '06 #9
I did apologized for being off topic here, but then...
---
Some people are really rude on what they say.
-k-

May 29 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by matthurne | last post: by
7 posts views Thread by yoyo | last post: by
3 posts views Thread by noleander | last post: by
25 posts views Thread by krbyxtrm | last post: by
17 posts views Thread by Amy | last post: by
9 posts views Thread by Ben Rudiak-Gould | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.