473,473 Members | 4,208 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

+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 2337
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark Turney | last post by:
Problem: I have a vector full of two different derived class objects (class B and class C) that are derived from the same base class A. I want to loop through vector and invoke a member function...
9
by: matthurne | last post by:
I need to send just an array to a function which then needs to go through each element in the array. I tried using sizeof(array) / sizeof(array) but since the array is passed into the function,...
7
by: yoyo | last post by:
Is there anyway to delay a trigger from firing for a few seconds? I have an after insert trigger on table1, which selects information from table2 and table3. Obviously it cannot fire unless the...
3
by: noleander | last post by:
Hi. I'm doing some speed optimization on my Visual C++ program. I'm using timers throughout the program. I'm calling ftime() which works well, but only returns current time to a millisecond...
25
by: krbyxtrm | last post by:
hello i have this profile for iterating empty vectors: +0.3us (microsecond) on intel pentium 2.4Ghz can this added delay to my application be reduced? i mean near zero delay, its very important....
17
by: Amy | last post by:
Hi, I finished this script and for some reason there is a delay every so often in the timing. Sometimes it seems two take 2 seconds instead of 1. Can anyone see anything that would slow it down? I...
9
by: Ben Rudiak-Gould | last post by:
Background: I have some structs containing std::strings and std::vectors of other structs containing std::strings and std::vectors of .... I'd like to make a std::vector of these. Unfortunately the...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.