JVM 11+ (OpenJDK / Zulu)

sobota, 5 lutego 2022 o 12:30:38 UTC+1 [email protected] napisaƂ(a):

> which jvm?
>
> On Sat, Feb 5, 2022 at 6:26 AM r r <[email protected]> wrote:
>
>> Hello,
>> we know that there are some techniques that make virtual calls not so 
>> expensive in JVM like Inline Cache or Polymorphic Inline Cache. 
>>
>> Let's consider the following situation:
>>
>> Base is an interface. 
>>
>> public void f(Base[] b) {
>>     for(int i = 0; i < b.length; i++) {
>>           b[i].m();   
>>     }
>> }
>>
>> I see from my profiler that calling virtual (interface) method m is 
>> relatively expensive.
>> f is on the hot path and it was compiled to machine code (C2) but I see 
>> that call to m is a real virtual call. It means that it was not 
>> optimised by JVM. 
>>
>> The question is, how to deal with a such situation? Obviously, I cannot 
>> make the method m not virtual here because it requires a serious 
>> redesign. 
>>
>> Can I do anything or I have to accept it? I was thinking how to "force" 
>> or "convince" a JVM to 
>>
>> 1. use polymorphic inline cache here - the number of different types in b 
>> is quite low - between 4-5 types.
>> 2. to unroll this loop - length of b is also relatively small. After an 
>> unroll it is possible that Inline Cache will be helpful here.
>>
>> Thanks in advance for any advices.
>> Regards,
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "mechanical-sympathy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/mechanical-sympathy/9b52b34e-6388-4cba-b89e-ce7521109cban%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mechanical-sympathy/9b52b34e-6388-4cba-b89e-ce7521109cban%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Studying for the Turing test
>

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/mechanical-sympathy/670d90ee-4b2d-4688-8987-f22646811d1dn%40googlegroups.com.

Reply via email to