Skip to content

perf: remove redundant reinitialization of policyMap#137

Merged
hsluoyz merged 1 commit intoapache:masterfrom
rushitote:perf
May 13, 2022
Merged

perf: remove redundant reinitialization of policyMap#137
hsluoyz merged 1 commit intoapache:masterfrom
rushitote:perf

Conversation

@rushitote
Copy link
Copy Markdown
Contributor

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
Copy Markdown

CLAassistant commented May 12, 2022

CLA assistant check
All committers have signed the CLA.

@casbin-bot
Copy link
Copy Markdown

@Edmond-J-A please review

@casbin-bot casbin-bot requested a review from Edmond-J-A May 12, 2022 17:55
@casbin-bot
Copy link
Copy Markdown

@Edmond-J-A please review

@hsluoyz
Copy link
Copy Markdown
Member

hsluoyz commented May 13, 2022

@leeqvip

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

🎉 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.

4 participants