Skip to content

fix: FastEnforcer not fast#344

Merged
leeqvip merged 1 commit intoapache:masterfrom
mbierma:bugfix/faster-fast-enforcer
May 21, 2024
Merged

fix: FastEnforcer not fast#344
leeqvip merged 1 commit intoapache:masterfrom
mbierma:bugfix/faster-fast-enforcer

Conversation

@mbierma
Copy link
Copy Markdown
Contributor

@mbierma mbierma commented May 20, 2024

Description

The FastEnforcer class has a check to see if FastEnforcer._cache_key_order is None. If None, the enforcer does not use the fast_policy_filter which provides significant performance enhancements. This is likely a bug, as FastEnforcer._cache_key_order refers to the class variable, and not the current instance's value. self._cache_key_order should be checked instead.

Related Issues

#336
#71

@casbin-bot
Copy link
Copy Markdown

@Nekotoxin please review

@casbin-bot casbin-bot requested a review from Nekotoxin May 20, 2024 07:12
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2024

CLA assistant check
All committers have signed the CLA.

@hsluoyz
Copy link
Copy Markdown
Member

hsluoyz commented May 20, 2024

@mbierma fix CI errors:

image

@mbierma
Copy link
Copy Markdown
Contributor Author

mbierma commented May 20, 2024

@mbierma fix CI errors:

@hsluoyz should be good to go now

@leeqvip leeqvip merged commit 8aef43b into apache:master May 21, 2024
@hsluoyz
Copy link
Copy Markdown
Member

hsluoyz commented May 21, 2024

@leeqvip the CI for this PR didn't pass. And the new release has been blocked. See: https://github.com/casbin/pycasbin/actions/runs/9169440383 . I will revert this PR.

image

github-actions bot pushed a commit that referenced this pull request May 21, 2024
## [1.36.1](v1.36.0...v1.36.1) (2024-05-21)

### Bug Fixes

* FastEnforcer not fast ([#344](#344)) ([8aef43b](8aef43b))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.36.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@leeqvip
Copy link
Copy Markdown
Contributor

leeqvip commented May 21, 2024

Passed after re-run.

@hsluoyz
Copy link
Copy Markdown
Member

hsluoyz commented May 21, 2024

@leeqvip great!

@mbierma mbierma deleted the bugfix/faster-fast-enforcer branch May 21, 2024 17:58
Chimou0 pushed a commit to Chimou0/pycasbin that referenced this pull request Jul 17, 2025
Co-authored-by: mbierma <3448579-mbierma@users.noreply.gitlab.com>
Chimou0 pushed a commit to Chimou0/pycasbin that referenced this pull request Jul 17, 2025
## [1.36.1](apache/casbin-pycasbin@v1.36.0...v1.36.1) (2024-05-21)

### Bug Fixes

* FastEnforcer not fast ([apache#344](apache#344)) ([8aef43b](apache@8aef43b))
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.

5 participants