Solved

How to test the performance of a multi-threaded applicaiton?

Posted on 2011-03-15
6
394 Views
Last Modified: 2012-05-11
Hey,

       I was working on a parallel search engine in Java, and I got a working version of the code, but I was trying to figure out a way to measure the performance of the code.  After a few google searches, the best link I found was http://developers.sun.com/solaris/articles/javapps.html .  

I was wondering if there was any free open source programs, or other such API's that test the performance of multi-threaded Java programs.

Appreciate any help on this.
0
Comment
Question by:errang
6 Comments
 
LVL 14

Assisted Solution

by:Dushyant Sharma
Dushyant Sharma earned 100 total points
ID: 35137554
have you tried net beans profiler. i have been using it a lot and it does help.
0
 
LVL 5

Assisted Solution

by:paulqna
paulqna earned 200 total points
ID: 35141183
Freeware tool Jmeter has concurrent thread and group thread sampling.
0
 
LVL 8

Expert Comment

by:Volox
ID: 35145748
What platform are you on?

When I'm running this type of thing on Windows I tend to use windows performance counters.  There is a lot of good information you can get about how many threads, how much memory, and various other helpful information you can get form the standard perf counters.

The other approach I've used is to have a static test scneario that provides a 'known quantity' set of test cases and then run that through measuring average processing time etc.  The 'how' of getting average times is generally writing code within your application that captures the data and logs it out somehow - either as a time for each item or as a captured average witin the application.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:errang
ID: 35148465
>>What platform are you on?

I use a Mac... but if there are better tools built into Windows, I can test this on Windows.

>>When I'm running this type of thing on Windows I tend to use windows performance counters.

Sorry, I don't know what these are?
0
 
LVL 8

Accepted Solution

by:
Volox earned 200 total points
ID: 35150054
Windows performance counters provide a system for monitoring performance that is fairly lightweight and built into the operating system.  There are a bunch of counters that allow you to see all the underlying performance aspects of the operating system, such as network bytes sent / bytes received, disk I/O measurements, processor information, memory commits, etc.  You can also build custom performance counters that allow you to measure your won metrics using the provided system.

Since Java doesn't have operating system specific functionality, it is a little harder to do custom performance counters in Java.  If you decide you want to try that, here is an article on it http://www.developer.com/java/data/article.php/3087741  But I can't speak to whether it works or not since I've never tried it.  Usually the operating system perf counters are good enough for what I've been doing in java.  (Part of that being because when I've been asked to do really high performance work it typically gets done in C#)

The tool you use to see all these counters is Performance Monitor (often referred to as Perf Mon).  It is under the 'Adminstrative Tools' on the start menu.  There are plenty of resources online about how to use it and what counters are useful versus which ones you probably don't care about.  Here is the techNet article to get you started... http://technet.microsoft.com/en-us/library/cc749249.aspx

Once you have the counters selected, you can setup a performance counter log that you can use to capture them to a file so that you can go back and review them over the period of time you were running your test.  The advantage here is that you can profile the performance of just your process (in this case java.exe) and time correlate the results to what you were doing in your test - which is way more effective than watching the CPU and memory meter as you go along (which is what I've seen some people do for perf testing).

0
 

Author Closing Comment

by:errang
ID: 35150578
Thanks a lot!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 191
servlet filter example 37 58
check java version using powershell 13 82
sp_configure 'external scripts enabled', 1; 7 49
A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now