title: Creating a local variable instead of calling a method to get data
body: <p>My question is about the efficient code. Please let me know which is the efficient approach among the given below. </p>
  
  <p>There's a method call to get an object. For eg., </p>
  
  <pre><code>relationship.getCommerceItem()
  </code></pre>
  
  <p>But, we need to call this method multiple times in a single line itself. So, I'm planning to create a local variable to replace the method call and store the return value. Like given below. </p>
  
  <pre><code>commerceItem = relationship.getCommerceItem()
  </code></pre>
  
  <p>Now, which approach is more efficient and why? </p>
  
  <p>Considering that this code will be executed in an environment where thousands and thousands of requests will be received. </p>