Skip to content

perf: use batches to decrease the number of concurrent db connections, use singleflight for more db queries, use subject filter where possible, use per-request concurrency limit - #3023

Open
maxmanuylov wants to merge 13 commits into
Permify:masterfrom
JetBrains:fix-concurrency

fix: review fixes

8f47504
Select commit
Loading
Failed to load commit list.
Codecov / codecov/patch failed Aug 4, 2026 in 1s

71.78% of diff hit (target 76.26%)

View this Pull Request on Codecov

71.78% of diff hit (target 76.26%)

Annotations

Check warning on line 290 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L289-L290

Added lines #L289 - L290 were not covered by tests

Check warning on line 315 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L315

Added line #L315 was not covered by tests

Check warning on line 337 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L336-L337

Added lines #L336 - L337 were not covered by tests

Check warning on line 339 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L339

Added line #L339 was not covered by tests

Check warning on line 346 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L346

Added line #L346 was not covered by tests

Check warning on line 365 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L365

Added line #L365 was not covered by tests

Check warning on line 410 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L410

Added line #L410 was not covered by tests

Check warning on line 422 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L422

Added line #L422 was not covered by tests

Check warning on line 444 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L443-L444

Added lines #L443 - L444 were not covered by tests

Check warning on line 446 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L446

Added line #L446 was not covered by tests

Check warning on line 453 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L453

Added line #L453 was not covered by tests

Check warning on line 474 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L474

Added line #L474 was not covered by tests

Check warning on line 578 in internal/engines/bulk.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/bulk.go#L578

Added line #L578 was not covered by tests

Check warning on line 53 in internal/engines/cache/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/cache/check.go#L53

Added line #L53 was not covered by tests

Check warning on line 105 in internal/engines/cache/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/cache/check.go#L105

Added line #L105 was not covered by tests

Check warning on line 75 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L75

Added line #L75 was not covered by tests

Check warning on line 129 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L125-L129

Added lines #L125 - L129 were not covered by tests

Check warning on line 188 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L187-L188

Added lines #L187 - L188 were not covered by tests

Check warning on line 298 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L298

Added line #L298 was not covered by tests

Check warning on line 306 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L306

Added line #L306 was not covered by tests

Check warning on line 432 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L432

Added line #L432 was not covered by tests

Check warning on line 440 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L440

Added line #L440 was not covered by tests

Check warning on line 573 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L573

Added line #L573 was not covered by tests

Check warning on line 579 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L579

Added line #L579 was not covered by tests

Check warning on line 587 in internal/engines/check.go

See this annotation in the file changed.

@codecov codecov / codecov/patch

internal/engines/check.go#L587

Added line #L587 was not covered by tests