There are situations where we can store values in local variables and work with them. For example:
String data;
int a, b;
data = Integer.toHexString(memory.read(PC));
a = ("00" + data).substring(data.length());
data = Integer.toHexString(memory.read(PC + 1));
b = ("00" + data).substring(data.length());
Or we can just make multiple function calls to achieve the same thing:
a = ("00" + Integer.toHexString(memory.read(PC))).substring(Integer.toHexString(memory.read(PC)).length());
b = ("00" + Integer.toHexString(memory.read(PC + 1))).substring(Integer.toHexString(memory.read(PC + 1)).length());
Which one is better from the performance point of view?