micronaut-core icon indicating copy to clipboard operation
micronaut-core copied to clipboard

Type pollution test

Open yawkat opened this issue 2 months ago • 0 comments

Add a test to the benchmarks module that runs certain JMH benchmarks with the redhat type pollution agent ( https://github.com/RedHatPerf/type-pollution-agent ) and triggers a test failure if there is excessive type pollution.

This works by adding a new test task which includes the agent, and then using JFRUnit to access the JFR events emitted by the agents. If there are too many thrash events for a single concrete type, details are logged and the test fails.

Additionally:

  • Add a JMH benchmark that mimics the TechEmpower benchmark
  • Fix various type pollution issues that were found using the FullHttpStackBenchmark

This PR is still pending the upstream PR to introduce JFR events to the agent ( https://github.com/RedHatPerf/type-pollution-agent/pull/19 ), and actual publishing of the type pollution agent. We will either wait for RH to publish the agent to maven central, or we will publish it ourselves if they don't want to do it (reply pending).

yawkat avatar Jun 18 '24 11:06 yawkat