Improve the performance of the new BatchEnforce() API

Open
#710 15 comments 0 reactions 1 assignee View on GitHub

@hsluoyz is already working on this.

Since Jan 7, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement

We add a very raw BatchEnforce() API here: https://github.com/casbin/casbin/issues/617

It simply call enforce() in a for loop. The performance is still low if you want to list all the objects that you have access. Our next step is to do something like "set" operation, e.g., given all the objects as a set, input it into the matcher and calculate the subset that fulfills the matcher, then we have the allowed object list.

Dominant language
Go
Stars
20.4k
Forks
1.8k
Avg merge
5d 11h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/casbin

All issues in apache/casbin

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.