RFR: 8262476: Add filter to speed up CompileCommand lookup

Vladimir Kozlov kvn at openjdk.java.net
Wed Mar 17 22:19:47 UTC 2021


On Wed, 17 Mar 2021 20:46:30 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

> This was reported as "Regression in class loading micro in 16-b27"
> 
> When adding Improving the CompileCommand flag in JDK-8256508 all commands was put in the same list (instead of an array of lists that would have been long and sparsely populated). Since commands are very uncommon that seemed like a reasonable thing - but I forgot about the JMH use case that adds a lot of inlining commands. With all commands in the same list, 1000 inlining commands will cause look-ups of all commands to take a lot of time.
> 
> This PR adds a filter so that we can quickly check if a command is present or not.

Caching information during commands registration and using it is correct fix.

>From what I see `has_command()` can use `filter_check()` too.
May be rename `filter_set()` into `set_command()` or something.
Rename `filter_check()` to `has_command()` and remove old `has_command()` method.

If I understand this code correctly.

-------------

Changes requested by kvn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3057


More information about the hotspot-compiler-dev mailing list