热点JIT优化 [英] Hotspot JIT optimizations
本文介绍了热点JIT优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Hotspot中有关JIT的讲座中,我想尽可能多地举例说明JIT执行的特定优化。
In a lecture about JIT in Hotspot I want to give as many examples as possible of the specific optimizations that JIT performs.
我只知道方法内联,但应该还有更多。
I know just about "method inlining", but there should be much more. Give a vote for every example.
推荐答案
好吧,您应该浏览Brian Goetz的文章以获取示例。
Well, you should scan Brian Goetz's articles for examples.
简而言之,HotSpot可以而且将会:
In brief, HotSpot can and will:
- 内联方法
- 在同一对象上加入相邻的
synchronized
块 - 如果无法从其他线程访问监视器,则取消锁定
- 消除死代码(因此大多数微基准都是毫无意义的)
- 为非
volatile
变量丢弃内存写操作 - 用直接方法调用替换接口调用,仅实现一次方法
- Inline methods
- Join adjacent
synchronized
blocks on the same object - Eliminate locks if monitor is not reachable from other threads
- Eliminate dead code (hence most of micro-benchmarks are senseless)
- Drop memory write for non-
volatile
variables - Replace interface calls with direct method calls for methods only implemented once
其他情况
这篇关于热点JIT优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文