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>
The RepositoryManager
pre_process_request
does guard against the secondary requests (theif handler is not Chrome(self.env):
test does that).The timeline
pre_process_request
does nothing and itspost_process_request
does also a check (theif 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.