Skip to main content

Whats CHA?

3 replies [Last post]
linuxhippy
Offline
Joined: 2004-01-07

Hi there,

In the past there have been some very interesting publications about hotspot (however since 2000 its unfourtunatly totally quiet :( ) and I found some papers which talk about the inlineing capabilities of hotspot.

It mentions that most methods can be inlined thanks to CHA. But whats that? I guess its CH-Analysis but whats CH ;)

Another interesting question for me is wether hotspot also inlines static methods, since all benchmark show that static method invocation is slower than a "normal" one.

Thank you in advance, lg Clemens

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mernst
Offline
Joined: 2005-02-19

Class Hierarchy Analysis exploits (through knowledge of all classes currently loaded) whether a virtual method has only one implementation in the current universe.

I.e. there is no subclass of StringTokenizer that overrides #hasMoreTokens, so any call to StringTokenizer#hasMoreTokens can potentially be inlined.

Any optimization taken based on this knowledge may need to be invalidated when a new class is loaded into the VM. For example, when com.mortbay.Util.QuotedStringTokenizer gets loaded, resp. its first instance is created.

linuxhippy
Offline
Joined: 2004-01-07

Ah, thanks a lot - now its clear.

I already knew this type of optimization-strategy but did not know that its called CHA ;)

Thanks again, lg Clemens

alexlamsl
Offline
Joined: 2004-09-02

Google yields the following answer:

CHA - Class Hierarchy Analysis

http://www.cs.washington.edu/research/projects/cecil/www/pubs/hierarchy....