runbot/runbot_merge/models
Xavier-Do 2ad188201b [IMP] runbot_merge: speedup frontend page
The mergebot page become a bit slow with the years, it is time to make
small optimisation to speed up thinks a little.

Note: all changes where applied modifying the views or adding index by
hand. There is still room for improvement but it would need more in
depth refactoring, mainly adding specialized computed fields to
enable a better batching.

The first issue was using branch.staging_ids

    branch.staging_ids.sorted(lambda s: s.staged_at, reverse=True)[:6]

The number of staging_ids is increasing and prefetching + sorting all
of them is slow.

The proposed solution is to replace it by a search, not ideal, a
specialized compute field may be a good idea, but this is a quick fix
that can be done editing a view.

    branch.env['runbot_merge.stagings'].search([('target', '=', branch.id)],order='staged_at desc', limit=6)

Other changes are just index on critical columns.

Before changes, /runbot_merge page takes ~5s to load
After changes,  /runbot_merge page takes ~1s to load

Small note: note 100% sure that runbot_merge.batch.target was useful
2023-04-05 09:05:50 +02:00
..
project_freeze [FIX] runbot_merge: cancel master staging on freeze 2023-01-25 12:25:45 +01:00
staging_cancel [ADD] runbot_merge: stagings canceling wizard 2022-12-08 10:46:22 +01:00
__init__.py [IMP] runbot_merge: add json & requests to server actions context 2023-02-20 10:13:05 +01:00
ir_actions.py [IMP] runbot_merge: add json & requests to server actions context 2023-02-20 10:13:05 +01:00
project.py [IMP] *: remove default group operator on objects 2022-12-08 10:46:22 +01:00
pull_requests.py [IMP] runbot_merge: speedup frontend page 2023-04-05 09:05:50 +02:00
res_partner.py [ADD] runbot_merge: remote user provisioning 2022-06-07 13:48:17 +02:00