Edgewall Software

Ticket #6826 (new enhancement)

Opened 9 months ago

Last modified 9 months ago

Excessive calls of filter.pre_process_request for one request

Reported by: jaguar.arx@… Owned by: cboos
Priority: normal Milestone: 0.13
Component: version control Version: 0.11b1
Severity: minor Keywords: filters pre_process_request TimelineModule RepositoryManager
Cc:

Description (last modified by cboos) (diff)

I tested work RepositoryManager.sync Found that it is called each time during the RequestDispatcher. And when the request was "js", "css" or "png" file, these filters are still operable. Also called filter of TimelineModule. I believe that this is unnecessary, they should operate only for the modules.

Example. I added an out to log in a line 284 of file trac\web\main.py and made a request to the page. This is what happened in the log.

2008-02-13 21:15:12,713 Trac[main] DEBUG: Dispatching <Request "GET u'/svnstat'">
2008-02-13 21:15:12,743 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:12,743 Trac[api] DEBUG: TEST: pre_process
2008-02-13 21:15:12,822 Trac[svn_fs] DEBUG: Subversion bindings imported
2008-02-13 21:15:12,838 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:12,838 Trac[session] DEBUG: Retrieving session for ID '4b626e0478ae6a5e20b1b01c'
2008-02-13 21:15:12,884 Trac[chrome] DEBUG: Prepare chrome data for request
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_CREATE on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing TRAC_ADMIN on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_GRANT on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing PERMISSION_REVOKE on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing TICKET_ADMIN on None
2008-02-13 21:15:12,900 Trac[perm] DEBUG: No policy allowed anonymous performing EMAIL_VIEW on None
2008-02-13 21:15:13,493 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/css/trac.css'">
2008-02-13 21:15:13,493 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:13,493 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:13,759 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/js/jquery.js'">
2008-02-13 21:15:13,759 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:13,759 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,588 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/js/trac.js'">
2008-02-13 21:15:14,588 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,588 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,665 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/js/search.js'">
2008-02-13 21:15:14,665 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,665 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,806 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/trac_banner.png'">
2008-02-13 21:15:14,806 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,806 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,822 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/trac_logo_mini.png'">
2008-02-13 21:15:14,822 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,822 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,869 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/topbar_gradient.png'">
2008-02-13 21:15:14,869 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,869 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:14,884 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/dots.gif'">
2008-02-13 21:15:14,884 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:14,884 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:15:15,009 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/common/topbar_gradient2.png'">
2008-02-13 21:15:15,026 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:15:15,026 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>
2008-02-13 21:36:56,960 Trac[main] DEBUG: Dispatching <Request "GET u'/login'">
2008-02-13 21:36:56,960 Trac[main] DEBUG: TEST: pre_process <trac.versioncontrol.api.RepositoryManager object at 0x01AD5B70>
2008-02-13 21:36:56,960 Trac[api] DEBUG: TEST: pre_process
2008-02-13 21:36:57,007 Trac[main] DEBUG: TEST: pre_process <trac.timeline.web_ui.TimelineModule object at 0x01AD5990>

Attachments

Change History

Changed 9 months ago by cboos

  • owner changed from jonas to cboos
  • severity changed from normal to minor
  • component changed from general to version control
  • description modified (diff)
  • milestone changed from 0.11.1 to 0.12

The RepositoryManager pre_process_request does guard against the secondary requests (the if handler is not Chrome(self.env): test does that).

The timeline pre_process_request does nothing and its post_process_request does also a check (the if data: test).

So in both cases, there's no real performance impact.

But for the next release, I'd like to change the way the repository synchronization is done (as that's not scalable with the MultipleRepositorySupport) and that IRequestFilter filter will be history.

Setting milestone to 0.12 as a reminder to clean-up the IRequestFilter.

Add/Change #6826 (Excessive calls of filter.pre_process_request for one request)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from cboos. Next status will be 'new'
The owner will change from cboos to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.