Skip to content

[IMP] bus_record_events: optimize mixin notification performance#2

Merged
zamberjo merged 2 commits into
17.0-add-bus_record_events-modulefrom
feat-performance-optimization
May 18, 2026
Merged

[IMP] bus_record_events: optimize mixin notification performance#2
zamberjo merged 2 commits into
17.0-add-bus_record_events-modulefrom
feat-performance-optimization

Conversation

@zamberjo

Copy link
Copy Markdown
Collaborator
  • Batch create notifications: emit one bus.bus row per batch with data.ids instead of one per record (O(N) → O(1))
  • Batch Many2one display_name resolution: prefetch all M2O values grouped by comodel to avoid N+1 queries (_prefetch_m2o_display_names)
  • Prefetch display_name for the whole recordset before the per-record loop using records.mapped("display_name")
  • Build notification dicts directly instead of copy()+mutate
  • Update tests to match new create payload shape (data.id → data.ids)

- Batch create notifications: emit one bus.bus row per batch with
  data.ids instead of one per record (O(N) → O(1))
- Batch Many2one display_name resolution: prefetch all M2O values
  grouped by comodel to avoid N+1 queries (_prefetch_m2o_display_names)
- Prefetch display_name for the whole recordset before the per-record
  loop using records.mapped("display_name")
- Build notification dicts directly instead of copy()+mutate
- Update tests to match new create payload shape (data.id → data.ids)
@zamberjo zamberjo self-assigned this May 11, 2026
@zamberjo zamberjo requested review from maurochip and sersanchus May 11, 2026 12:06
@zamberjo zamberjo marked this pull request as ready for review May 11, 2026 12:13
@zamberjo zamberjo merged commit 183e384 into 17.0-add-bus_record_events-module May 18, 2026
4 checks passed
@zamberjo zamberjo deleted the feat-performance-optimization branch May 18, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants