Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove redundant reinitialization of policyMap #137

Merged
merged 1 commit into from
May 13, 2022

Conversation

rushitote
Copy link
Member

In reference with #136.

The policyMap is being reinitialized entirely from the policy at every line load, instead we can set the mapping for every line as it is being loaded.

Running a benchmark script to load a medium sized model (1k policies and 10k grouping policies) from file:

(current)
Time = 37181.17 ms
(after this change)
Time = 92.94 ms

@CLAassistant
Copy link

CLAassistant commented May 12, 2022

CLA assistant check
All committers have signed the CLA.

@casbin-bot
Copy link
Member

@Edmond-J-A please review

@casbin-bot
Copy link
Member

@Edmond-J-A please review

@hsluoyz
Copy link
Member

hsluoyz commented May 13, 2022

@leeqvip

@hsluoyz hsluoyz merged commit 6b4efc4 into casbin:master May 13, 2022
@github-actions
Copy link

🎉 This PR is included in version 1.41.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants