Bug #42147
optim time slots, lazy id
Début:
27 avril 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
Quand il y a 800000 timeslots la génération de l'id
'%s:%s' % (self.meeting_type.id or self.meeting_type.slug, self.start_datetime.strftime('%Y-%m-%d-%H%M'))
se fait sentir.
Et l'id n'est pas nécessaire.
+from django.utils.functional import cached_property ... - self.id = '%s:%s' % (meeting_type.id or meeting_type.slug, start_datetime.strftime('%Y-%m-%d-%H%M')) self.desk = desk + + @cached_property + def id(self): + return '%s:%s' % (self.meeting_type.id or self.meeting_type.slug, self.start_datetime.strftime('%Y-%m-%d-%H%M')) +
Temps global réduit de 25 à 19 secondes en faisant ça.
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 4 ans
- Fichier 0001-misc-create-timeslot-virtual-id-on-demand-42147.patch 0001-misc-create-timeslot-virtual-id-on-demand-42147.patch ajouté
- Statut changé de En cours à Solution proposée
- Patch proposed changé de Non à Oui
#42142 pour la branche et le jenkins.
Mis à jour par Lauréline Guérin il y a environ 4 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
Poussé il y a quelques jours déjà,
commit cf030d8e4dcaf306014467efbcfc26575818011f Author: Frédéric Péters <fpeters@entrouvert.com> Date: Mon Apr 27 18:19:15 2020 +0200 misc: create timeslot virtual id on-demand (#42147)
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
misc: create timeslot virtual id on-demand (#42147)