Edgewall Software

Opened 9 years ago

Closed 9 years ago

Last modified 2 years ago

#2891 closed defect (fixed)

Timeline performance broken in [2990]

Reported by: rbrown@… Owned by: cboos
Priority: highest Milestone: 0.10.1
Component: timeline Version: devel
Severity: normal Keywords: timeline performance
Cc: manuzhai@…, m@…
Release Notes:
API Changes:


As discussed on the mailing list, I have found that changeset [2990] has resulted in a more than tenfold increase in the amount of time it takes to render the timeline. It only affects changeset items, which is consistent with the nature of the changeset in question.

Attachments (0)

Change History (12)

comment:1 Changed 9 years ago by cboos

  • Milestone set to 0.10
  • Owner changed from jonas to cboos
  • Status changed from new to assigned

comment:2 Changed 9 years ago by cboos

  • Priority changed from normal to highest

Please try out the following patch:

Index: trac/versioncontrol/web_ui/changeset.py
--- trac/versioncontrol/web_ui/changeset.py     (revision 3015)
+++ trac/versioncontrol/web_ui/changeset.py     (working copy)
@@ -651,16 +651,17 @@
             rev, path = chgset[:sep], chgset[sep:]
             rev, path = chgset, None
-        repos = self.env.get_repository()
-        try:
-            chgset = repos.get_changeset(rev)
+        cursor = formatter.db.cursor()
+        cursor.execute('SELECT message FROM revision WHERE rev=%s', (rev,))
+        row = cursor.fetchone()
+        if row:
             return '<a class="changeset" title="%s" href="%s">%s</a>' \
-                   % (util.escape(util.shorten_line(chgset.message)),
+                   % (util.escape(util.shorten_line(row[0])),
                       formatter.href.changeset(rev, path), label)
-        except TracError, e:
-            return '<a class="missing changeset" title="%s" href="%s"' \
+        else:
+            return '<a class="missing changeset" href="%s"' \
                    ' rel="nofollow">%s</a>' \
-                   % (str(e), formatter.href.changeset(rev, path), label)
+                   % (formatter.href.changeset(rev, path), label)

     def _format_diff_link(self, formatter, ns, params, label):
         def pathrev(path):

comment:3 Changed 9 years ago by anonymous

  • Cc manuzhai@… added

comment:4 Changed 9 years ago by rbrown@…

The patch posted appears to fix the problem. I'm now running on trunk + the patch and the timeline is working as fast as it does normall.


comment:5 follow-up: Changed 9 years ago by cboos

  • Resolution set to fixed
  • Status changed from assigned to closed

Ok, so I applied the patch in r3026. I'll look for a better fix later (i.e. making get_repository() cheap).

comment:6 Changed 9 years ago by cmlenz

IIUC correctly, this change means that the repository is no longer synced before a changeset link is encountered in wiki text. So you'll get a ”missing changeset” link for a changeset that isn't yet in the cache.

comment:7 Changed 9 years ago by cboos

You're right, but this is simply the pre-2990 behavior. I'm currently writing a mail for Trac-Dev in order to discuss this, among other things.

comment:8 in reply to: ↑ 5 Changed 9 years ago by cboos

Replying to cboos:

… I'll look for a better fix later (i.e. making get_repository() cheap).

As matt reintroduced the usage of get_repository in r3971, I added a (per-request) cache of Repository objects in r3980.

This will be later refined to allow for multiple repositories (see VcRefactoring#SupportforMultipleRepositories).

comment:9 Changed 9 years ago by Markus Tacker <m@…>

  • Cc m@… added
  • Milestone 0.10 deleted
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 0.9.4 to devel

I am reopening this ticket because the timeline is dead slow. I can't get the timeline of even small projects to display. It nearly killed my webserver, too.

r3994 is my version.

comment:10 Changed 9 years ago by Markus Tacker <m@…>

Alos affected is the browser and the log view.

comment:11 Changed 9 years ago by Markus Tacker <m@…>

  • Resolution set to fixed
  • Status changed from reopened to closed

Hm, this was related to a DNS problem. But why?

comment:12 Changed 9 years ago by cboos

  • Milestone set to 0.10.1

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cboos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from cboos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.