0

Are there common Hotspot JIT optimizations for its String concatenations especially when using the + operator? Where do I look and what tools do I use in order to investigate JIT source code for String concatenation optimization?

I was looking for answers to my other question and I think I should just check the codes out myself.

Edit: There is a similar question on optimization Java Optimizations that asks for difference in performance when assigning to a variable first. However, what I'm looking for is specific to String concatenation.

Community
  • 1
  • 1
damat-perdigannat
  • 5,780
  • 1
  • 17
  • 33
  • write your code to be readable and maintainable, let the compiler do its job, the compiler writers are smarter than you, especially if you have to ask this question. Anything you try and do to *hint* will just keep it from doing its job. http://stackoverflow.com/questions/16258809/jvm-jit-diagnostic-tools-and-optimization-tips?rq=1 as well –  Aug 26 '14 at 03:07
  • @JarrodRoberson Thanks, I'll read your links. If you could see my other post I think you would understand better why I'm asking this. http://stackoverflow.com/questions/25442323/thread-safety-of-the-plus-operator-for-strings – damat-perdigannat Aug 26 '14 at 03:10
  • 1
    @JarrodRoberson I don't think this question is a duplicate. The other link is asking for difference in performance when assigning to a variable first. The other question doesn't have the answers I'm looking for. – damat-perdigannat Aug 26 '14 at 03:22
  • **there are no answers to this question, and if there were, they would change from JIT/JVM implementation to implementation, and from version to version**. there is nothing you can do to *improve* on what is already being done or influence what is being done, that is kind of the point of JIT black box compilations. –  Aug 26 '14 at 07:25
  • 1
    @JarrodRoberson could you unmark the question from being duplicate so that other people can answer? I would like to confirm with other users regarding the blackbox compilations stuff too. – damat-perdigannat Aug 26 '14 at 08:09

0 Answers0