question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance issues with ~20k policies

See original GitHub issue

Was wondering if anyone else is experiencing a slow down even with a relatively low number of policies.

For our ~20k policies we notice it takes around 5 seconds to evaluate them.

Here is our conf.

[request_definition]
r = type, resourceId, userId, action

[policy_definition]
p = type, resourceId, userId, action

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = r.type == p.type && r.resourceId == p.resourceId && r.userId == p.userId && r.action == p.action

We have seemed to narrowed it down to this line in coreEnforcer.ts

Switching from compileAsync to compile and removing the await brought us down to around 40ms with the same amount of policies.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:27 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
nodececommented, Oct 26, 2019

@hsluoyz, I think @dreamdevil00 provide the solution is good. But in Casbin, If matcher has async function and using compile , the enforce doest not provide the correct result.

0reactions
nodececommented, Oct 29, 2019

v3.0.5 has been published to npm.

Use enforceWithSyncCompile instead of enforce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Outlook performance issues in a Cached Exchange Mode .ost ...
Describes performance issues if there are lots of items or folders in a Cached Exchange Mode .ost or .pst file. Provides a resolution....
Read more >
Blog: Building Performance Policy Brief | ENERGY STAR
In this first issue, we're providing background and highlighting recently passed building performance policies affecting existing U.S. commercial and ...
Read more >
Amazon layoffs now expected to mount to 20,000, including ...
Amazon plans to lay off as many as 20,000 employees across the company ... should try to identify work performance problems among employees, ......
Read more >
Dominant port? And performance problems (2 questions) - Dell
A couple of years ago, a DMX Symmetrix Performance Expert was at my ... in one port group (this friend has a 20k...
Read more >
Cash Value Life Insurance Explained – Forbes Advisor
Exact rules on graded death benefits can vary, so make sure you understand them before buying guaranteed issue life insurance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found