Forums Register Login

I don't understand these profiles - what is taking all the CPU-time?

+Pie Number of slices to send: Send
Hi,

http://www2.binf.ku.dk/~biehl/profile1.jpg
http://www2.binf.ku.dk/~biehl/profile2.jpg

with data (for the netbeans 5 profiler)

http://www2.binf.ku.dk/~biehl/prof1.nps
http://www2.binf.ku.dk/~biehl/prof2.nps

I don't understand where all of the cpu-time is used? Is something not inlined? What can explain such a profile?

Thanks
Anders

PS This is also posted at http://forums.java.net/jive/thread.jspa?threadID=1888&tstart=0 but that forum doesn't seem very alive.
+Pie Number of slices to send: Send
Can you post the Protein.calcEnergy method? That's where all the time is spend...
+Pie Number of slices to send: Send
Here's the method - but one thing I find strange is that on from the first to the second profile i reorganized some of the methods - but then the large time consumption just moved in the call hierachy.

And also - I wonder what the time that is not marked as "self" in a method is spent on (except other methods). The numbers dont add up. "self" + "other methods" < total time.

-Anders
/**
* Calculate the entire energy for this protein. This is done by an all vs
* all check. However the energy is symmetric, so if A <-> B is done, then
* avoid B <-> A.
*
* @return whether a hard-core overlap was detected
*/
public boolean calcEnergy() {
// update the Energy

totalEnergy = 0;

boolean overlap = false;
for (int i = 0; i < ncalf; i++) {
Monomer monI = monomers[i];

for (int j = i; j < ncalf; j++) {
Monomer monJ = monomers[j];
int indexDist = Math.abs(j - i);

if (indexDist > 1 && overlap(monI, monJ)) {
overlap = true;
break;
}
totalEnergy += energyMatrix
.calcEnergy(monI, monJ, monJ.pos);
}
}
return overlap;
}
+Pie Number of slices to send: Send
Actually it's EnergyMatrix.calcEnergy where all the time is going, right?
+Pie Number of slices to send: Send
> Actually it's EnergyMatrix.calcEnergy where all the time is going, right?

Well, it depends - in profile1 it looks that way. But after a bit of code - reorg - in profile2 it is Protein.calcEnergy that takes all the time. And the really strange part is that the "EnergyMatrix.calcEnergy" that takes all the time in profile1 is the two-parameter one of the two methods below.
This is why I question if I understand the profiles correctly?

Anders


/**
* Calculate the contact energy between the two monomers
*
* @param m1
* @param m2
* @return the contact energy value
*/
public static double calcEnergy(Monomer m1, Monomer m2){
return calcEnergy(m1, m2, m2.pos);
}

/**
* Calculate the contact energy between the two monomers
*
* @param m1
* @param m2
* @param m2Pos the position to be used for m2 in stead of
* m2.pos
* @return the contact energy value
*/
public static double calcEnergy(Monomer m1, Monomer m2, Point m2Pos){
final float energy = matrix[m1.aa.ordinal()][m2.aa.ordinal()];
double dist = m1.pos.distanceTo(m2Pos);
double ddist = dist - m1.aa.size - m2.aa.size;
//TODO clean up
return energy*distanceFactor(ddist);
}
[ November 07, 2005: Message edited by: Anders Norgaard ]
+Pie Number of slices to send: Send
It *may* be a bug in the NetBeans profiler. At least, as you I don't understand the output.
+Pie Number of slices to send: Send
Ok - it was a bug in the profiler - now fixed - yay!

http://forums.java.net/jive/thread.jspa?threadID=1888&tstart=0
Look ma! I'm selling my stuff!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1138 times.
Similar Threads
Errors in WSDL2Java
[Java] BigDecimal Limitation
Generic Question
Printing element name using JAXB 2.0
Glassfish and Eclipse - publish on server problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:08:03.