Skip to content

fix: improve performance by removing non-essential but resource-intensive logging#140

Merged
hsluoyz merged 2 commits intoapache:masterfrom
nic-chen:ferf/log
Jan 12, 2023
Merged

fix: improve performance by removing non-essential but resource-intensive logging#140
hsluoyz merged 2 commits intoapache:masterfrom
nic-chen:ferf/log

Conversation

@nic-chen
Copy link
Copy Markdown
Member

fix part of #136

Thank you very much for a previous pr for performance optimization.

However, in actual use, it is found that when the policy exceeds 20k lines, it still takes about 4 seconds for the API to load for the first time.

After digging deeper, I found out that it was because of o.model:printPolicy() after load policy, so I removed it. I think we already has a detailed log when enforce, and there is no need to save all policy content in the log, what do you think?

(current)
Time =  about 4s
CPU = 100%
(after this change)
Time = about 200 ms
CPU = 2%

@casbin-bot
Copy link
Copy Markdown

@Edmond-J-A @rushitote please review

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 12, 2023

CLA assistant check
All committers have signed the CLA.

@hsluoyz hsluoyz changed the title perf: remove non-essential but resource-intensive logging fix: improve performance by removing non-essential but resource-intensive logging Jan 12, 2023
@hsluoyz hsluoyz merged commit 1ce390f into apache:master Jan 12, 2023
@nic-chen nic-chen deleted the ferf/log branch January 12, 2023 08:12
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.41.3 🎉

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