Will Java source compiled for Java 8 be any more efficient compiled with newer javac?How do I efficiently iterate over each entry in a Java Map?Efficiency of Java “Double Brace Initialization”?IntelliJ inspection gives “Cannot resolve symbol” but still compiles codeDealing with “Xerces hell” in Java/Maven?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?Specifying java version in maven - differences between properties and compiler pluginIs there any benefit to upgrading Java 7 compiled code to Java 8?Does Java JIT cheat when running JDK code?Why does array[idx++]+=“a” increase idx once in Java 8 but twice in Java 9 and 10?Why does a Java class compile differently with a blank line?

Return a String containing only alphabets without spaces

Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?

Reactive Programming

Generate basis elements of the Steenrod algebra

Electricity free spaceship

If I leave the US through an airport, do I have to return through the same airport?

Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?

Solve Riddle With Algebra

Who won a Game of Bar Dice?

How to publish items after pipeline is finished?

Advantages of the Exponential Family: why should we study it and use it?

Live action TV show where High school Kids go into the virtual world and have to clear levels

How can I use String in enum for Apex?

How creative should the DM let an artificer be in terms of what they can build?

What would be the way to say "just saying" in German? (Not the literal translation)

Is it expected that a reader will skip parts of what you write?

Why Does Mama Coco Look Old After Going to the Other World?

First sign that you should look for another job?

Why is long-term living in Almost-Earth causing severe health problems?

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letter

How to communicate to my GM that not being allowed to use stealth isn't fun for me?

Should I put programming books I wrote a few years ago on my resume?

bash does not know the letter 'p'

USGS Relief map (GeoTIFF raster) misaligns with vector layers (QGIS)



Will Java source compiled for Java 8 be any more efficient compiled with newer javac?


How do I efficiently iterate over each entry in a Java Map?Efficiency of Java “Double Brace Initialization”?IntelliJ inspection gives “Cannot resolve symbol” but still compiles codeDealing with “Xerces hell” in Java/Maven?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?Specifying java version in maven - differences between properties and compiler pluginIs there any benefit to upgrading Java 7 compiled code to Java 8?Does Java JIT cheat when running JDK code?Why does array[idx++]+=“a” increase idx once in Java 8 but twice in Java 9 and 10?Why does a Java class compile differently with a blank line?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I work on a codebase that uses Java 8.



I created a set of JMH-based benchmarks that give me a certain set of numbers, using Java 8.



I then ran those compiled classes with Java 9, 10, 11, and 12, and got other sets of numbers.



My question is, if I recompile those classes with corresponding compilerVersion, source, and target properties in the pom, should I expect to see any statistically significant changes in those numbers?



In other words, if I run the Java8-compiled classes with Java 9, will I expect to see any real differences in then numbers if I instead compile the classes first with Java 9, and and then run them with Java 9 (and same question for 10, 11, and 12)?



Note that I'm not asking about running Maven with a different version of Java (but I would do that also), I'm talking about changing the properties in the maven-compiler-plugin to represent that version.



I believe the answer to this question would be no, I should not expect any noticeable differences in the timings, as I believe that Java 8 compatible source code would compile to the same bytecode that the Java 9, 10, 11, and 12 compiler would produce.










share|improve this question






















  • Did you see statistically significant differences? I would expect the answer to be no, since the Java compiler is pretty "dumb": it produces equivalent bytecode with little or no optimization, so you will see little or no difference in the produced bytecode. All the smarts are in the JVM that you run that code on.

    – Andy Turner
    Mar 24 at 19:59












  • Can you post your benchmarks? Or at least describe what they do?

    – Nestor Sokil
    Mar 24 at 20:02






  • 2





    You can of course test your beliefs by inspecting the bytecode produced by the different versions to see if there are any differences.

    – Andy Turner
    Mar 24 at 20:06






  • 1





    Generally speaking, I think it is most possible, that there are such differences in runtime and the JVM executes your code differently. The bytecode is most likely the same (although the spec does not prohibit it from changing in a newer version), but a lot of stuff could have been changed in JIT.

    – Nestor Sokil
    Mar 24 at 20:20






  • 1





    Without knowing the code, this is difficult to judge, there are major difference between Java 8 and Java 9 +, most notably the module system (though if your code was written for java 8 this shouldn't be a factor). However I do believe that java 9 also now uses UTF8 for String representation, which may be a factor with respect to bench marking?

    – Bill Naylor
    Mar 24 at 20:27


















1















I work on a codebase that uses Java 8.



I created a set of JMH-based benchmarks that give me a certain set of numbers, using Java 8.



I then ran those compiled classes with Java 9, 10, 11, and 12, and got other sets of numbers.



My question is, if I recompile those classes with corresponding compilerVersion, source, and target properties in the pom, should I expect to see any statistically significant changes in those numbers?



In other words, if I run the Java8-compiled classes with Java 9, will I expect to see any real differences in then numbers if I instead compile the classes first with Java 9, and and then run them with Java 9 (and same question for 10, 11, and 12)?



Note that I'm not asking about running Maven with a different version of Java (but I would do that also), I'm talking about changing the properties in the maven-compiler-plugin to represent that version.



I believe the answer to this question would be no, I should not expect any noticeable differences in the timings, as I believe that Java 8 compatible source code would compile to the same bytecode that the Java 9, 10, 11, and 12 compiler would produce.










share|improve this question






















  • Did you see statistically significant differences? I would expect the answer to be no, since the Java compiler is pretty "dumb": it produces equivalent bytecode with little or no optimization, so you will see little or no difference in the produced bytecode. All the smarts are in the JVM that you run that code on.

    – Andy Turner
    Mar 24 at 19:59












  • Can you post your benchmarks? Or at least describe what they do?

    – Nestor Sokil
    Mar 24 at 20:02






  • 2





    You can of course test your beliefs by inspecting the bytecode produced by the different versions to see if there are any differences.

    – Andy Turner
    Mar 24 at 20:06






  • 1





    Generally speaking, I think it is most possible, that there are such differences in runtime and the JVM executes your code differently. The bytecode is most likely the same (although the spec does not prohibit it from changing in a newer version), but a lot of stuff could have been changed in JIT.

    – Nestor Sokil
    Mar 24 at 20:20






  • 1





    Without knowing the code, this is difficult to judge, there are major difference between Java 8 and Java 9 +, most notably the module system (though if your code was written for java 8 this shouldn't be a factor). However I do believe that java 9 also now uses UTF8 for String representation, which may be a factor with respect to bench marking?

    – Bill Naylor
    Mar 24 at 20:27














1












1








1


0






I work on a codebase that uses Java 8.



I created a set of JMH-based benchmarks that give me a certain set of numbers, using Java 8.



I then ran those compiled classes with Java 9, 10, 11, and 12, and got other sets of numbers.



My question is, if I recompile those classes with corresponding compilerVersion, source, and target properties in the pom, should I expect to see any statistically significant changes in those numbers?



In other words, if I run the Java8-compiled classes with Java 9, will I expect to see any real differences in then numbers if I instead compile the classes first with Java 9, and and then run them with Java 9 (and same question for 10, 11, and 12)?



Note that I'm not asking about running Maven with a different version of Java (but I would do that also), I'm talking about changing the properties in the maven-compiler-plugin to represent that version.



I believe the answer to this question would be no, I should not expect any noticeable differences in the timings, as I believe that Java 8 compatible source code would compile to the same bytecode that the Java 9, 10, 11, and 12 compiler would produce.










share|improve this question














I work on a codebase that uses Java 8.



I created a set of JMH-based benchmarks that give me a certain set of numbers, using Java 8.



I then ran those compiled classes with Java 9, 10, 11, and 12, and got other sets of numbers.



My question is, if I recompile those classes with corresponding compilerVersion, source, and target properties in the pom, should I expect to see any statistically significant changes in those numbers?



In other words, if I run the Java8-compiled classes with Java 9, will I expect to see any real differences in then numbers if I instead compile the classes first with Java 9, and and then run them with Java 9 (and same question for 10, 11, and 12)?



Note that I'm not asking about running Maven with a different version of Java (but I would do that also), I'm talking about changing the properties in the maven-compiler-plugin to represent that version.



I believe the answer to this question would be no, I should not expect any noticeable differences in the timings, as I believe that Java 8 compatible source code would compile to the same bytecode that the Java 9, 10, 11, and 12 compiler would produce.







java jmh






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 19:54









David M. KarrDavid M. Karr

6,491951115




6,491951115












  • Did you see statistically significant differences? I would expect the answer to be no, since the Java compiler is pretty "dumb": it produces equivalent bytecode with little or no optimization, so you will see little or no difference in the produced bytecode. All the smarts are in the JVM that you run that code on.

    – Andy Turner
    Mar 24 at 19:59












  • Can you post your benchmarks? Or at least describe what they do?

    – Nestor Sokil
    Mar 24 at 20:02






  • 2





    You can of course test your beliefs by inspecting the bytecode produced by the different versions to see if there are any differences.

    – Andy Turner
    Mar 24 at 20:06






  • 1





    Generally speaking, I think it is most possible, that there are such differences in runtime and the JVM executes your code differently. The bytecode is most likely the same (although the spec does not prohibit it from changing in a newer version), but a lot of stuff could have been changed in JIT.

    – Nestor Sokil
    Mar 24 at 20:20






  • 1





    Without knowing the code, this is difficult to judge, there are major difference between Java 8 and Java 9 +, most notably the module system (though if your code was written for java 8 this shouldn't be a factor). However I do believe that java 9 also now uses UTF8 for String representation, which may be a factor with respect to bench marking?

    – Bill Naylor
    Mar 24 at 20:27


















  • Did you see statistically significant differences? I would expect the answer to be no, since the Java compiler is pretty "dumb": it produces equivalent bytecode with little or no optimization, so you will see little or no difference in the produced bytecode. All the smarts are in the JVM that you run that code on.

    – Andy Turner
    Mar 24 at 19:59












  • Can you post your benchmarks? Or at least describe what they do?

    – Nestor Sokil
    Mar 24 at 20:02






  • 2





    You can of course test your beliefs by inspecting the bytecode produced by the different versions to see if there are any differences.

    – Andy Turner
    Mar 24 at 20:06






  • 1





    Generally speaking, I think it is most possible, that there are such differences in runtime and the JVM executes your code differently. The bytecode is most likely the same (although the spec does not prohibit it from changing in a newer version), but a lot of stuff could have been changed in JIT.

    – Nestor Sokil
    Mar 24 at 20:20






  • 1





    Without knowing the code, this is difficult to judge, there are major difference between Java 8 and Java 9 +, most notably the module system (though if your code was written for java 8 this shouldn't be a factor). However I do believe that java 9 also now uses UTF8 for String representation, which may be a factor with respect to bench marking?

    – Bill Naylor
    Mar 24 at 20:27

















Did you see statistically significant differences? I would expect the answer to be no, since the Java compiler is pretty "dumb": it produces equivalent bytecode with little or no optimization, so you will see little or no difference in the produced bytecode. All the smarts are in the JVM that you run that code on.

– Andy Turner
Mar 24 at 19:59






Did you see statistically significant differences? I would expect the answer to be no, since the Java compiler is pretty "dumb": it produces equivalent bytecode with little or no optimization, so you will see little or no difference in the produced bytecode. All the smarts are in the JVM that you run that code on.

– Andy Turner
Mar 24 at 19:59














Can you post your benchmarks? Or at least describe what they do?

– Nestor Sokil
Mar 24 at 20:02





Can you post your benchmarks? Or at least describe what they do?

– Nestor Sokil
Mar 24 at 20:02




2




2





You can of course test your beliefs by inspecting the bytecode produced by the different versions to see if there are any differences.

– Andy Turner
Mar 24 at 20:06





You can of course test your beliefs by inspecting the bytecode produced by the different versions to see if there are any differences.

– Andy Turner
Mar 24 at 20:06




1




1





Generally speaking, I think it is most possible, that there are such differences in runtime and the JVM executes your code differently. The bytecode is most likely the same (although the spec does not prohibit it from changing in a newer version), but a lot of stuff could have been changed in JIT.

– Nestor Sokil
Mar 24 at 20:20





Generally speaking, I think it is most possible, that there are such differences in runtime and the JVM executes your code differently. The bytecode is most likely the same (although the spec does not prohibit it from changing in a newer version), but a lot of stuff could have been changed in JIT.

– Nestor Sokil
Mar 24 at 20:20




1




1





Without knowing the code, this is difficult to judge, there are major difference between Java 8 and Java 9 +, most notably the module system (though if your code was written for java 8 this shouldn't be a factor). However I do believe that java 9 also now uses UTF8 for String representation, which may be a factor with respect to bench marking?

– Bill Naylor
Mar 24 at 20:27






Without knowing the code, this is difficult to judge, there are major difference between Java 8 and Java 9 +, most notably the module system (though if your code was written for java 8 this shouldn't be a factor). However I do believe that java 9 also now uses UTF8 for String representation, which may be a factor with respect to bench marking?

– Bill Naylor
Mar 24 at 20:27













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327949%2fwill-java-source-compiled-for-java-8-be-any-more-efficient-compiled-with-newer-j%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327949%2fwill-java-source-compiled-for-java-8-be-any-more-efficient-compiled-with-newer-j%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript