addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [ljc] Performance Tuning of a large Method

From: Venudhar G.
Sent on: Tuesday, October 23, 2012, 2:58 PM
Are you sure you have done enough profiling of the code. I would use a tool like yourkit to profile the whole method.  The outcome of this exercise should list out the highest consumers in terms of cpu cycles.

Is it definetly the collections that are the bottlenecks. Or is it slow because of gc activity?
What kind of collections are used?
Unless you are using collections from java concurent api ,  when two threads  access the collection entire object will be locked . So is this the reason for slowness?

I would take threaddumps to find out where the resource contention is.

I woukd take a heapdump to inspect objects in memory. 

Regards
-Venu
Sent from Samsung Mobile

Craig Silk <[address removed]> wrote:
Good morning,

I'm working on a rather high trafficked ecommerce platform at the moment where I seem to having some performance issues.

I've hooked visualJVM up to the application to find that one particular method is taking over 40 seconds to complete when load is high. Looking at the method, I see it's a 185 line copy and paste job from a legacy codebase that has some rather verbose conditionals and lots of interactions with Collections.

I know I haven't given enough information for anyone to really help me but I'm curious as to how you would generally go about dealing with a 185 line, synchronised java method that was lifted out of a legacy codebase. Where am I supposed to begin when refactoring this mess?

Craig




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Craig Silk ([address removed]) from LJC - London Java Community.
To learn more about Craig Silk, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

People in this
group are also in: