Projet

Général

Profil

Bug #42147

optim time slots, lazy id

Ajouté par Frédéric Péters il y a environ 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
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

Révision cf030d8e (diff)
Ajouté par Frédéric Péters il y a environ 4 ans

misc: create timeslot virtual id on-demand (#42147)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Assigné à mis à Frédéric Péters
#2

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Nouveau à En cours
#4

Mis à jour par Frédéric Péters il y a environ 4 ans

#42142 pour la branche et le jenkins.

#5

Mis à jour par Lauréline Guérin il y a environ 4 ans

  • Statut changé de Solution proposée à Solution validée
#6

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)
#7

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

Formats disponibles : Atom PDF