runbot/runbot_merge/views
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
..
configuration.xml [IMP] mergebot, forwardbot: various UI bits 2022-06-30 15:07:49 +02:00
mergebot.xml [IMP] runbot_merge: a few backend screens 2022-08-05 15:35:51 +02:00
queues.xml [IMP] mergebot, forwardbot: various UI bits 2022-06-30 15:07:49 +02:00
res_partner.xml [IMP] runbot_merge: a few backend screens 2022-08-05 15:35:51 +02:00
runbot_merge_project.xml [ADD] runbot_merge: ~~tree~~ freeze wizard 2021-11-17 10:40:12 +01:00
templates.xml [IMP] runbot_merge: speedup frontend page 2023-04-05 09:05:50 +02:00