Skip to content

Conversation

@yawkat
Copy link
Member

@yawkat yawkat commented Jun 18, 2024

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 ( RedHatPerf/type-pollution-agent#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).

renovate bot and others added 5 commits June 14, 2024 10:38
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…10904)

* Fixes #10665 Ensuring the deserialization has access to the ServerRequestContext

* Adding a test to ensure that large request payloads still have access to the ServerRequestContext on deserialization.
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 ( RedHatPerf/type-pollution-agent#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).
@graemerocher graemerocher added the type: improvement A minor improvement to an existing feature label Jun 18, 2024
dstepanov and others added 17 commits June 26, 2024 16:13
The test is reproducing Jackson's default behaviour with primitives and a way to change it

micronaut-projects/micronaut-serialization#880
….1 (#10770)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…174 (#8882)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…in to v0.4.3 (#10885)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…-dataformat-yaml to v2.17.2 (#10954)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
# Conflicts:
#	http-server-netty/src/main/java/io/micronaut/http/server/netty/binders/NettyBodyAnnotationBinder.java
@yawkat yawkat added this to the 4.6.0 milestone Jul 17, 2024
@yawkat yawkat changed the base branch from 4.5.x to 4.6.x July 17, 2024 15:14
@yawkat yawkat marked this pull request as ready for review July 17, 2024 15:15
@sonarqubecloud
Copy link

return new ArrayList<>(0);
}
List<GenericHttpFilter> httpFilters = new ArrayList<>(alwaysMatchesFilterRoutes.size());
ArrayList<GenericHttpFilter> httpFilters = new ArrayList<>(alwaysMatchesFilterRoutes.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just use var?

private final Supplier<ArrayList<GenericHttpFilter>> alwaysMatchesHttpFilters = SupplierUtil.memoized(() -> {
if (alwaysMatchesFilterRoutes.isEmpty()) {
return Collections.emptyList();
return new ArrayList<>(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment why this cannot be emptyList or List.of

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the field to be ArrayList to avoid an interface cast, so this lambda has to return ArrayList as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: improvement A minor improvement to an existing feature

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

9 participants