How can we find hot paths in a Java library we own but don't consume?

November 14, 2026 3 answers
Asked by _lightly+offbeat_9

Our team publishes Java libraries used by other teams. The company profiler requires each environment to onboard, and its data is indexed by environment, so we can't easily see or aggregate every use of our libraries. What else could we try?

Answers

n608!sprocketcase

Start with the biggest consumers and ask what performance problems they actually see. A CPU hotspot in one application may not matter much in another, so getting a few profiles alongside the workload context is more useful than treating them as one universal ranking.

If nobody has reported a problem, decide what you're trying to improve before spending a lot of time optimizing. HotSpot also optimizes code based on how the application runs it, which makes representative workloads valuable.

Reply to this answer
unhurried+sidequest_6

Telemetry could help fill the gap, especially around public library operations. Counts and timing distributions can show which operations are common or slow across participating consumers, though they won't replace a CPU profile for finding expensive internal call paths.

Keep the instrumentation lightweight and coordinate with consumers on overhead, data access, and what gets collected. You'll still need to account for environments that don't enable it.

Reply to this answer
Tavell.5j

This sounds partly like a tooling problem. Talk to the team responsible for the company profiler about a library-centric view or a way to aggregate profiles from onboarded environments. That won't magically cover teams that haven't onboarded, but it could make the data you do have much easier to use.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions