Hi Apache Commons Pool community, I hope this email finds you well. I'd
like to take feedback on a performance enhancement for Commons Pool, and if
my understanding is correct.

*Problem Statement*
While analyzing pool performance under high load, I identified that
detailed statistics collection (mean active time, mean idle time, mean
borrow wait time) can become a bottleneck in high-throughput scenarios.
These statistics, while valuable for monitoring, involve timing
calculations and circular buffer operations that add overhead to every
borrow/return operation. For applications that prioritize throughput over
detailed monitoring, there is no way to disable this overhead, and it leads
to useful threads blocked on the synchronized block.

[image: Screenshot 2025-08-22 at 1.40.11 AM.png]
Proposed SolutionImplement a new configuration option
collectDetailedStatistics that allows users to disable detailed
timing statistics collection.

I'm happy to discuss any aspects of this proposal or make adjustments based
on community feedback. Also, I apologize in advance if I've missed any
basic understanding of updateStatsBorrow/Return, and this change would
impact any functional behaviour of the Pool. Any guidance or corrections
would be greatly appreciated. And if this looks fine, I'll go ahead and
raise the PR.

Thanks.

Reply via email to