Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Madeline Ross   on Sep 18 In Java Category.

  
Question Answered By: Louis Mason   on Sep 18

I am not sure how Java does it, but I am quite sure on
how C/C++ does it, and I think it will be similar in
the JVM code. By passing  three paramaters, you have
to push the pointers to three values in the stack.
And one parameter  would only be pushing one value on
the stack, so therefore the less parameters  should be
faster, but this happens so quick it is not a
performance hit.

In your scenerio, I would pass the class's reference,
because the three get calls would be unnecessary. But
this does not mean everytime there are three or more
parameters create a class  to encapsulate the
parameters just to make it faster. This is definitely
not where you need to concentrate on performance
tweaks.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on parameter performance Or get search suggestion and latest updates.


Tagged: