Hi,
Benchmarking code running inside an IDE is worse than useless: it's both
misleading and a waste of time.  IDEs can do a lot of things
(pre-caching, pre-creating threads, getting DB connections, etc) that
skew results.  Test the performance of something as you would run it in
production.  If you think it should be faster, run it with a profiler
(not an IDE) to see where time is spent, and tune those areas as needed.

Yoav Shapira http://www.yoavshapira.com


>-----Original Message-----
>From: Alex Pointer [mailto:[EMAIL PROTECTED]
>Sent: Thursday, December 09, 2004 9:55 AM
>To: [EMAIL PROTECTED]
>Subject: Performace differences when running application in Tomcat and
>JBuilder
>
>I have a problem to do with the performance of a server process I
>developed when used in Tomcat, in comparison with running it in
JBuilder X
>
>I have a JAR file that is the server process, that when a method is
called
>from Tomcat takes 35 seconds to run, while the same method called in
>JBuilder X takes 12.5 seconds
>
>Why does Tomcat take over twice as long to run the same code as when
run
>from JBuilder X, and is there a way I can make Tomcat run the code
faster?
>
>Any help, explanation would be appreciated
>
>Details can be found bellow:
>
>
>The complexities of the method are:
>        - using a Oracle JDBC Thin driver, it will connect to a remote
>Oracle database over a 10Mbit connection and run a single SELECT query
>that will return 85 records. (The SELECT query is always the same)
>        - each record in the resultset will have a object created that
>represents it (each record has 129 fields).
>        - the record is copied out of the resultset and into the object
by
>using the meta-data provided with the resultset to identify the correct
>setter method for the correct field for each record.
>        - the resultset is kept open during the entire action and is
>passed with its cursor set to each object that then populates itself.
>        - after each object is populated the resultset cursor is moved
to
>the next record.
>        - this is done in a single thread (one object after the other),
>and stored in an array of objects.
>        - the array of objects are then returned by the method.
>
>The first and last line of the called method are logging the current
time.
>
>To run this method in Tomcat (I have tried versions 4.1.24, 5.0.18,
>5.0.28, 5.5.4)
>I write a web application that I deploy as a .war file in the webapps
>directory.
>I copy the JAR file into the shared\lib folder, because it need to be
>accessed by more than one web application.
>When a link on the website is clicked it calls the server process.
>(because I am only looking at the times within the server process any
>delay caused by the webapp calling the server process is ignored).
>It takes the same amount of time (to within a few milliseconds) every
time
>the link is clicked, so the compilation of any files cannot be causing
the
>problem.
>
>To run this method in JBuilder X
>I run a main method in a separate project that has the JAR file added
into
>its Included Libraries.
>(I assume running this way is the same as running it directly to the
JVM
>at the command line)
>The code is run automatically.
>
>Both Tomcat, and JBuilder X are running on the same Windows 2000
machine,
>and no error or exception is reported during the execution.
>*******************************************************
>This email has originated from Steria Limited, Registration No:
2706218.
>
>Privileged, confidential and/or copyright information may be contained
in
>this email, and is only for the use of the intended addressee. To copy,
>forward, disclose or otherwise use it in any way if you are not the
>intended recipient or responsible for delivering to him/her is
prohibited.
>
>If you receive this email by mistake, please advise the sender
immediately,
>by using the reply facility in your email software.
>
>We may monitor the content of emails sent and received via our network
for
>the purposes of ensuring compliance with policies and procedures.
>
>This message is subject to and does not create or vary any contractual
>relationships between Steria Limited and the recipient.
>
>Office registered at: Three Cherry Trees Lane, Hemel Hempstead,
>Hertfordshire, HP2 7AH
>www.steria.co.uk
>******************************************************



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to