You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
Thanks for the detailed response. I am currently learning C++, so am not aware of the DLL concept. However, everything else makes sense to me.Delsilon– Delsilon2019-01-04 16:41:17 +00:00Commented Jan 4, 2019 at 16:41
-
1This is a much better answer but I think though that the distinction between interpreted and JIT isn't as cut-and-dried as it seems from this answer (the wiki link does provide more nuance.) The main benefit of JIT isn't loading and unloading. The big benefit of JIT is the ability to apply optimizations at runtime based on empirical data from actual execution. A section of code that was compiled to machine instructions might be rewritten many times based on how it's used. JIT also allows for things like stack allocation even though Java doesn't provide any direct mechanism for that.JimmyJames– JimmyJames2019-01-04 18:09:59 +00:00Commented Jan 4, 2019 at 18:09
-
@JimmyJames: In HotSpot in particular, the main benefit of JIT is the ability to deoptimize. You can make compiler optimizations even if you cannot prove that they are correct, and then simply throw away the code and fall back on interpretation in case your optimizations were wrong. For example, escape analysis is equivalent to solving the halting problem, so you can't know whether values will escape or not, but you can simply stack-allocate values anyway under the assumption that they won't escape, and when they do, you just re-allocate on the heap.Jörg W Mittag– Jörg W Mittag2019-01-09 16:54:25 +00:00Commented Jan 9, 2019 at 16:54
-
@JörgWMittag That doesn't really make much sense to me. In order to believe that, we'd have to think that initial optimization is only done to allow for more deoptimizing. "so you can't know whether values will escape or not", I'm not so sure about that. I can look at code and point to values that never escape. There are cases where it's not provable and a more aggressive optimizer can try that which comes back point of deoptimization: to allow for more aggresive optimization i.e. it's part of optimization, not the other way around.JimmyJames– JimmyJames2019-01-09 17:12:57 +00:00Commented Jan 9, 2019 at 17:12
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-java