473,407 Members | 2,306 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,407 software developers and data experts.

benchmarking c programs

Ben
Hi,
I am wondering if there is an easy way to benchmark a c program as a way of measuring the efficiency of the program,
specifically the number of different instructions performed and total running time.
I have used other languages where the interpreter has a built-in flag to give you this information but not sure what the
equivalent is in c.
cheers,
Ben
Jun 11 '06 #1
1 1679
Ben <be*********@spam.me> wrote:
Hi,
I am wondering if there is an easy way to benchmark a c program as a way of measuring the efficiency of the program,
specifically the number of different instructions performed and total running time.
I have used other languages where the interpreter has a built-in flag to give you this information but not sure what the
equivalent is in c.
cheers,
Ben

Some compilers -- e.g. gcc -- have a "profiling" feature that allow you to
automatically count the number of times each line/statement is executed.
If you want to count "instructions" then some x86 processors (and others)
allow you to setup counters for certain "events" such as instruction fetches
or memory read/writes. But that is a function of the operating system.
If you want to measure program runtime and guestimate the number of instructions
executed (not forgetting with multiple pipeline machines these days, this is
not to squeezy anymore) then you're also outside the (strictly) C domain
and into operating system functionality & tools.
Jun 11 '06 #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,...
10
by: Michel Rouzic | last post by:
I need to determine how long does an addition take and how long does a multiplication takes. So far I've been trying to use the clock() function in my programs in order to find out how long it took...
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.
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...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.