I saw that git pages on forge-allura.apache.org were slow, so I looked at stats.log and saw that the sidebar was the slowest part. I did some additional digging and found 2 specific areas for improvement:
git_main.py
change default_branch_name
to a @LazyProperty
since it is called many times inside a loop in RepositoryApp.sidebar_menu
sidebar_menu
only requests a certain number of branches, pass that "limit" all the way through to git_repo.py
's branches
method so that is_valid()
is only called a minimum number of times needed.In addition to those changes, generalize and apply the same approach to the tags. And also check ForgeHg to see if mercurial can benefit the same way.
Looking good!
Overall timings are much better with caching enabled. First page hit still can be slow, though. What do you think about updating the cache in
repo_refresh
also, not just clearing it up?Also what do you think on including the
ref_list = getattr(self._git, field_name)
line inside timing measure for cache? Or is it always very fast, so we can ignore that?Minor issues:
print
statements in tests should be removeddevelopment.ini
SF-specific: I guess we need to add
repo_refs_cache_threshold = .5
toconfigtree
also.Last edit: Igor Bondarenko 2015-06-16
Great notes -- The initial load is much quicker now :)
Updated @ hs/7873
As for the configtree... do I just append CONFIGTREE to the ticket name?
I think this is finally done :)
However I got new test failure
Is caching enabled in tests? I suggest we disable it in tests by default and enable only whenever needed.
Other than that looks/works good.
Regarding configtree, I meant we should made changes to the "configtree" repo (
/var/local/configtree
on a sandbox). I've made the changed and pushed them toib/7873
already, so don't worry about that.AFAIK yes, we should add "NEEDS CONFIGTREE" to the ticket description after we close the ticket, so that it will be immediately visible that ticket requires configuration changes. It helps when we organize notes for the release and also for siteops, I guess.
You can go ahead and merge this (both allura and configtree), whenever test is fixed.
Last edit: Igor Bondarenko 2015-06-17
Actually I think "NEEDS INI" would be better on the ticket title since "configtree" is an internal thing to sourceforge. (SF people can infer that INI means check configtree)