Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Maven benchmarking and add profiling support #571

Merged

Conversation

lptr
Copy link
Member

@lptr lptr commented Sep 2, 2024

@lptr lptr self-assigned this Sep 2, 2024
@lptr lptr changed the title Improve Maven benchmarking and profiling support Improve Maven benchmarking and add profiling support Sep 2, 2024
@lptr lptr force-pushed the lptr/maven-becnhmarking-and-profiling branch 4 times, most recently from 0b5130e to f6c87da Compare September 3, 2024 17:00
@lptr lptr force-pushed the lptr/maven-becnhmarking-and-profiling branch from f6c87da to 3b425f3 Compare September 3, 2024 19:12
@lptr lptr changed the base branch from master to lptr/schedule-file-operations September 4, 2024 08:37
@lptr lptr marked this pull request as ready for review September 4, 2024 09:01
@lptr lptr merged commit 14ae24e into lptr/schedule-file-operations Sep 4, 2024
9 of 10 checks passed
@lptr lptr deleted the lptr/maven-becnhmarking-and-profiling branch September 4, 2024 09:02
SnapshotCapturingProfilerController controller;
// TODO This only works with Async profiler, since the only thing we call from the controller is stopSession()
// Capture this in the type hierarchy somehow
if (settings.getProfiler() instanceof InstrumentingProfiler) {
Copy link
Member

@asodja asodja Sep 4, 2024

Choose a reason for hiding this comment

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

🤔 Should we throw exception if profiler is not instance of InstrumentingProfiler?

Another idea:
Maybe a profiler would have something like:
Profiler.supports(BuildTool)

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 tried that, but it got a bit ugly. I think the answer is to remodel the relationship between profilers and build tools on a bit deeper level, but it's a more impactful change than I think will fit in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's continue on #576

/**
* Whether this profiler supports only Gradle builds.
*/
public abstract boolean requiresGradle();
Copy link
Member

Choose a reason for hiding this comment

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

🤔 It's a bit unfortunate we have this boolean requiresGradle(), maybe we could have some more generic method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, 100%. Again, let's discuss how we want to model this relationship.

Copy link
Member Author

Choose a reason for hiding this comment

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

Essentially, there are profilers that can run via Java agent, and profilers that can run as an external process, and profilers that support both.

And then there are build tools that support supplying an agent (Gradle, Maven), build tools that support a long running daemon (Gradle only), and build tools that support neither (Buck and Bazel might be these, at least as a start).

I think this can be modeled nicely, and will make the compatibility between tool and profiler be obvious.

Copy link
Member Author

Choose a reason for hiding this comment

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

// TODO This only works with Async profiler, since the only thing we call from the controller is stopSession()
// Capture this in the type hierarchy somehow
if (settings.getProfiler() instanceof InstrumentingProfiler) {
InstrumentingProfiler profiler = (InstrumentingProfiler) settings.getProfiler();
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Do we need this cast?

Copy link
Member

@asodja asodja Sep 4, 2024

Choose a reason for hiding this comment

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

Oh I guess because of profiler.newSnapshottingController`, I wonder how we could make that differently without a cast 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what I dislike about this, yes. I think we should re-model how profilers and build tools work together, but that's outside the scope of this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's continue on #576

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

Successfully merging this pull request may close these issues.

2 participants