Jaymr1031-Z opened a new pull request, #1750: URL: https://github.com/apache/casbin/pull/1750
Fixes #1690 ### Problem In util/builtin_operators.go, mustCompileOrGet() guarded regex cache access with a global sync.RWMutex ( eCacheMu). Under high-throughput concurrent policy evaluation across multiple goroutines, the mutex lock contention created unnecessary bottlenecks. ### Solution - Replace eCache (map[string]*regexp.Regexp) and eCacheMu (sync.RWMutex) with a thread-safe, lock-free sync.Map. - Use eCache.Load and eCache.LoadOrStore inside mustCompileOrGet for lock-free read-heavy access. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
