Java: what is JITC's reflection inflation?

前端 未结 3 1921
臣服心动
臣服心动 2020-12-24 15:49

I recently came across this interesting term and searched on Net to know more about it. However the info I found is sketchy. Could someone pl. give me a somewhat detailed ex

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-24 16:24

    Not sure though but read this somewhere Inflation means that for the first few runs (default 15) of a reflected method/constructor (from now on, any reference to methods applies to constructors too), it does so via JNI; the next time after that, it assembles a class file on the fly, and loads it. At that point, full JITting applies, and further calls to that reflected method has the same performance as directly calling that method

提交回复
热议问题