casbin / jcasbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Java
https://casbin.org
Apache License 2.0
2.38k stars 461 forks source link

Benchmark for SyncedEnforcer #98

Closed cici-debug closed 4 years ago

cici-debug commented 4 years ago

I am trying to get benchmark for SyncedEnforcer and found that increasing threadPool size won't increase the qps for enforce because write lock is used when function syncedEnforcer.enforce() is called. However, in golang version, they use read lock instead. Does that mean the golang benchmark for SyncedEnforcer would be much higher than jcasbin? I'm curious why a write lock is needed in enforce phase since no policy is changed.

hsluoyz commented 4 years ago

@tldyl please fix this issue. We can change all unnecessary write locks to read locks.

hsluoyz commented 4 years ago

Fixed in: https://github.com/casbin/jcasbin/pull/99