Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Please convey me which is best in regarding performance and Y  RSS feed

 
damodar kumar
Ranch Hand
Posts: 77
Android Chrome MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a DAO method in which another DAO method
for example
from below two code snippets which is good in regarding performance



 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only differences I'm seeing is a second parameter and an extra connection
(disclaimer: it's late).

Usually connections are expensive to setup so the second one should be faster.
However I have no clue about what methodB does and what the second parameter does.
It could perform a large task that nullifies the performance impact of the second connection.

Also there are a lot of variables that could influence the performance e.g. cache, connection
pool, synchronization etc.. The only real way to know which one is faster is to experiment
and measure.
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what does "Y" mean in your post title?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!