473,379 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Benchmarking

Hey there, I have a question about benchmarking. I'm hoping you can help but
I'm not sure if this group is dedicated to just standard C++. Here's the
question, I have a piece of code I would like to benchmark down to less than
a second
resolution. Previously, when I wanted to do this for a merge sort function I
was able to just include time.h declare a couple of clock_t's and do the
path. However for my current project that doesn't seem to be working out.

Specifically what I'm trying to benchmark right now is how much time I'm
waiting to complete a read and write operation over a network socket. My
program encodes some data in XML and pushes it out to a server over a raw
socket to be processes. Currently it takes about one second to push out 5
messages which to me seems pretty darned slow. My problem is when I do the
following:

clock_t start = 0;

clock_t end = 0;

start = clock();

......

Perform read/write operation

......

end = clock();

I will get the same value for start and end, thus as far as my program is
concerned it took no time at all to process the request (something I'm
having a hard time believing). A co-worker of mine looked up the clock in
one of his MS chm files and according to that clock() will only return the
number of clocks while your program was running, there for if I'm spending
all my time in I/O wait it wouldn't work out. I'm not sure if that's
universally true, and my project runs runs on linux and not windows. If
anyone can help that would be great. Thanks,

Carlo Razzeto
Jul 22 '05 #1
1 1837
Carlo Razzeto wrote:
Hey there, I have a question about benchmarking. I'm hoping you can help but
I'm not sure if this group is dedicated to just standard C++.
Take a habit of checking the newsgroup's FAQ and reading it a bit before
posting to it, and you will never have to make such statements.

To dimiss your doubts, yes, this newsgroup is dedicated to just standard
C++ language (and library).
Here's the
question, I have a piece of code I would like to benchmark down to less than
a second
resolution.
This is not guaranteed by the language. 'clock' resolution can be 1 tick
per second, for all we know.
Previously, when I wanted to do this for a merge sort function I
was able to just include time.h declare a couple of clock_t's and do the
path. However for my current project that doesn't seem to be working out.

Specifically what I'm trying to benchmark right now is how much time I'm
waiting to complete a read and write operation over a network socket. My
program encodes some data in XML and pushes it out to a server over a raw
socket to be processes. Currently it takes about one second to push out 5
messages which to me seems pretty darned slow. My problem is when I do the
following:

clock_t start = 0;

clock_t end = 0;

start = clock();

.....

Perform read/write operation

.....

end = clock();

I will get the same value for start and end, thus as far as my program is
concerned it took no time at all to process the request (something I'm
having a hard time believing). A co-worker of mine looked up the clock in
one of his MS chm files and according to that clock() will only return the
number of clocks while your program was running, there for if I'm spending
all my time in I/O wait it wouldn't work out. I'm not sure if that's
universally true, and my project runs runs on linux and not windows. If
anyone can help that would be great. Thanks,


Use a profiler, 'gprof'. Post to comp.os.linux.development.apps.

V
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dean J. Garrett | last post by:
Does anyone know of a good tool for benchmarking ASP applications; performance, scalability, etc.? Thank you!
0
by: Rob | last post by:
Good afternoon, I'm looking for information on good benchmarking implementations with which to test MySQL using multiple clients. The benchmark utilities included with MySQL are, as far as I...
1
by: Trevor Best | last post by:
Is there a ready made database for benchmarking a server's performance to see what tweaks external to SQL Server will have an effect? -- A)bort, R)etry, I)nfluence with large hammer.
3
by: Andy Dingley | last post by:
I've just started on a new project and inherited a huge pile of XSLT (and I use the term "pile" advisedly !) It runs at glacial speed, and I need to fix this this. Platform is MSXML 4 / ASP ...
6
by: Jens Himmelreich | last post by:
Hi, I am looking for a tool, to benchmark a page. I want to put a http-adress in and want to get the time it take to download the whole page. The whole page means: The HTML-page, the externel...
8
by: Jerry Coffin | last post by:
As promised, more benchmarking results of comparing C++ to Java. This time around, our first target will be the strcat program. This is one that the C++ version rather bothered me -- I'm...
0
by: Cyrille \cns\ Szymanski | last post by:
Hello, I'm benchmarking .NET IO Completion Ports in C#. For that purpose I've written two basic ECHO servers that I'm testing under high load (over 2.000 clients). IOCP in .Net is fantastic,...
4
by: lava | last post by:
BenchMarking and Profiling .NET Application Tools>>>Which should be World class providing accurate output. The Tools should Benchmark MY ..NET Remoting Server/Client and SQL Server Database.
7
by: Wisgary | last post by:
I'm doing some benchmarking tests to compare Microsoft's CLR against Mono's CLR. I could use some suggestions for how to objectively compare the code. To my surprise the few tests I've run so far...
2
by: chitranjan | last post by:
Hello All, I want to do Bechmarking of PostgreSQL on Linux (fedora) so,please tell me about benchmarking tools of postgresql which is easy to use and implement..It is very urgent for me to do...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.