title: Readability vs Performance
body: <p>Recently we had a discussion at work about the impact of local variables on the performance vs readability of Java code. Some of my colleagues are of the oppinion that declarations like this</p>
  
  <pre><code>new DoSomethingCmd(new SelectionContext(context, keys), infoStuff.getCurrentRole().getRole_id()).execute(getResultContainer());
  </code></pre>
  
  <p>will give the application a considerable performance boost. They are willing to sacrifice code readability for this. Are they right in claiming this? Is the above version significantly more performant than, say, this one?</p>
  
  <pre><code>final SelectionContext selectionContext = new SelectionContext(context, keys);
  final String roleId = infoStuff.getCurrentRole().getRole_id();
  final DeleteSomethingCmd deleteSomethingCmd = new DeleteSomethingCmd(selectionContext,roleId);
  deleteSomethingCmd.execute(getResultContainer());
  </code></pre>
  
  <p>I realise that the first statement isn't all that difficult to grasp in and on itself, but the complexity adds up rather quickly when most of your code is structured like that.</p>
  
  <p>Thank you for your input.</p>