Slow gnome-contacts startup



I have found out why gnome-contacts takes so long to start up. This loop in contacts-store.vala:

      foreach (var new_individual in changes.get (old_individual)) {
        if (old_individual != null && new_individual != null &&
        replaced_individuals.get (new_individual) == old_individual) {
          if (replacements == null)
        replacements = new HashSet<Individual> ();
          replacements.add (new_individual);
        } else if (old_individual != null) {
          /* Removing an old individual. */
          var c = Contact.from_individual (old_individual);
          this.remove (c);
        } else if (new_individual != null) {
          /* Adding a new individual. */
          this.add_contact (new Contact (this, new_individual));
          xi += 1;
        }
      }

Where I've put the xi counter, there are a few hundred add_contact calls and then a last big loop where there are 1402 calls. It seems those calls each allocate memory for the new Contact, which is not speedy.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]