Skip to content

Add PERFORMANCE_ANALYSIS.md: in-depth scalability analysis vs OpenJDK 21#112

Merged
pfirmstone merged 1 commit intotrunkfrom
copilot/analyze-performance-impact-dirty-chai
Apr 18, 2026
Merged

Add PERFORMANCE_ANALYSIS.md: in-depth scalability analysis vs OpenJDK 21#112
pfirmstone merged 1 commit intotrunkfrom
copilot/analyze-performance-impact-dirty-chai

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 18, 2026

Documents the concrete scalability advantages of Dirty Chai's authorization subsystem over the legacy OpenJDK implementation, with particular focus on ConcurrentPolicyFile and CombinerSecurityManager — two components that historically exposed severe lock contention under concurrent workloads.

What's covered

  • ConcurrentPolicyFile — lock-free implies() via a single volatile array read; no per-domain synchronized cache; no DNS calls during CodeSource comparison; bitwise case conversion in URI normalization; PermissionComparator avoids I/O-triggering Permission.hashCode()/equals()
  • CombinerSecurityManager — two independent non-blocking caches (checked: 20s TTL, contextCache: 60s TTL, both backed by ConcurrentHashMap/ConcurrentSkipListSet); parallel domain checks via VirtualThreadPerTaskExecutor for stacks ≥4 domains (converts serial SocketPermission waits to parallel); ScopedValue over ThreadLocal for recursion tracking
  • AccessControlContext interning — global ConcurrentSkipListMap cache with weak value refs; pre-computed hashCode; DomainIdentity/UriCodeSource eliminates DNS from cache-key equality checks
  • Legacy contention hotspots eliminated — maps each removed bottleneck (global policy class lock, synchronized WeakHashMap PDcache, reverse-DNS in CodeSource.implies(), serial domain stack evaluation) to its Dirty Chai replacement
  • Overhead introduced — quantifies the marginal cost of new guards (LoadClassPermission, SerialObjectPermission, NativeAccessPermission) relative to the paths they protect
  • JVM tuning guidance — large young-gen recommendation for CombinerSecurityManager's short-lived object pattern
  • Benchmark pointers — maps existing JMH microbenchmarks (DoPrivileged, GetContext, ProtectionDomainBench) to the subsystems they exercise

Copy link
Copy Markdown
Owner

@pfirmstone pfirmstone left a comment

Choose a reason for hiding this comment

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

Very thorough review.

@pfirmstone pfirmstone marked this pull request as ready for review April 18, 2026 08:42
@pfirmstone pfirmstone merged commit 29f4b42 into trunk Apr 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants