Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Mon, 30 Jun 2025 11:22:14 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3693: Overhead of uncontended use of ResourceLock In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 3018778450 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3693 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3693#issuecomment-3018778450 Content-Type: text/plain; charset=utf-8 > if you prefer - would you want to suggest exact settings you'd want to see? Frankly, I would love to see "all the backtraces for `ResourceLock`" to analyze what are the most common ones (something like https://bell-sw.com/announcements/2020/07/22/Hunting-down-code-hotspots-with-JDK-Flight-Recorder/#method-profiling-report ). I'm not sure how it is possible with flamegraph. I would prefer `collapsed` or `jfr` formats: https://github.com/async-profiler/async-profiler/blob/master/docs/OutputFormats.md#output-formats > That's nice but as a technical detail I'd very much prefer to inject my own instance rather than have it shaded within the driver for various reasons, such as minimize the number of classes being loaded (we'd be using Caffeine for other reasons too) "provide your own cache" could probably be a second artifact, however: * I'm not sure how it could be a drop-in replacement as the app should configure the cache class or for it * We could probably release both shaded and non-shaded variants. It would probably open a way for "use the same Caffeine as the project already using" and "skip use a user-provided cache" > our ability to optimise for GraalVM as well: Caffeine is tricky to handle efficiently in native images and if you were to shade it Sure we could bundle the rules as well.