Skip to content

[1.0.0] Optimize search entry filtering and ACL checks. - #368

Merged
ChadSikorra merged 4 commits into
FreeDSx:mainfrom
ChadSikorra:upgrade/search-result-gate
Oct 19, 2026
Merged

ChadSikorra merged 4 commits into
FreeDSx:mainfrom
ChadSikorra:upgrade/search-result-gate

Conversation

@ChadSikorra

Copy link
Copy Markdown
Contributor

This drastically reduces the number of walks we need to make per entry per attribute in the search path. Read decisions are now taken once per request for each attribute. There also some schema memoization / caching regarding subtype checks and operational attribute usage. This is really the last area of major optimization left in the search path. What remains is related to nagle's algorithm (in PCNTL) and also BER encoding (which is already heavily optimized in PHP). That would likely need some optional PHP extension to make any more gains.

This also makes the LDAP comparison bench more "fair". Fair in that all references now use ACL and bind as a user that doesn't bypass everything. It also uses more normal people entry seeds and attribute sizes. The comparisons are now kind of interesting, and I'm surprised how much performance you can squeeze out of PHP (especially with swoole).

* Seed the comparison with person entries.
* Run every side of a comparison under its own access control.
* Probe the run identity's writes before a comparison seeds.
* Count the entries a size-limited search returned in the load test.
An identity's read decisions are now taken once per request for each attribute. Only rules that depend on the entry's DN are asked per entry. A single gate applies them together with the selection so an entry is rebuilt at most once.
@ChadSikorra
ChadSikorra merged commit da50671 into FreeDSx:main Oct 19, 2026
14 checks passed
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.50779% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.07%. Comparing base (d26e070) to head (9640f3c).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...r/AccessControl/Read/ReadsEntryAttributesTrait.php 86.66% 2 Missing ⚠️
.../Server/AccessControl/Read/ReloadableReadScope.php 87.50% 2 Missing ⚠️
...x/Ldap/Server/AccessControl/Read/RuleReadScope.php 93.10% 2 Missing ⚠️
...erver/AccessControl/Read/UnrestrictedReadScope.php 80.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #368      +/-   ##
============================================
+ Coverage     89.93%   90.07%   +0.13%     
  Complexity       31       31              
============================================
  Files           745      755      +10     
  Lines         29411    31720    +2309     
============================================
+ Hits          26451    28572    +2121     
- Misses         2960     3148     +188     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant