I am working on a project in which we create a language that compiles in java. The frame we use (xtext) makes a fruitful use of boxing in its generated code. In particular, if you have an operator like:
int i = 1;
int j = 2;
int k = i + j;
Then the compiled code is as follows:
IntegerExtensions.operator_plus(((Integer)i), ((Integer)j))
Now, in the project I'm working on, there are certain situations where specific basic binary operations will be extremely common (especially increments and comparisons).
My question is: will this be a performance issue, or will the JIT (or similar JVM smart features) just figure out what's going on and fix it all?
PLEASE READ BEFORE POSITION: I'm not interested in getting answers saying "you don't care, make it readable." This code is generated, and I just don't care about the readability of the generated code. I take care that we do not get significant success in performance.
thank
source
share