Let's do a trace (e.g. start with TimerMiddleware verbose mode to get every pymongo call; maybe try line_profiler later) of common functionality to every page. Focus on just the core parts of allura, not looking into the specifics of whatever page you're on. Might be helpful to test hitting an external link URL, so there's not much tool-specific going on, just core route handling, project/tool lookup, permission checks, etc. Identify opportunities for improvement.
Automatically checking against mongo indexes would be awesome. Perhaps integrating with https://pypi.python.org/pypi/Dex/0.6 to use some of its functionality
Based on New Relic "xray sessions", potential candidates to investigate more are:
Neighborhood.query.get: 11% of avg _nav.json request. Time spent is all in mongo. Cache it for a while?install_anchored_tools: 15% of avg _nav.json request. Most of time spent is in mongo. Seems to be theself.app_configsproperty load?obj.neighborhood_project: 7.3% of avg _nav.json request. Cache it for a while?Artifact.refstaking 13% of avg ticket view, backrefs (5.2%), user icon_url which is already memozied (8.4%)Neighborhood.query.getis all over the place. For example in a discussion thread, each post callsUser.icon_urlwhich callsprivate_projectwhich usesself.neighborhoodbut even though that is aLazyPropertyit is instance-level so doesn't get re-used much. There are many other places too.We could have a general purpose Neighborhood cache system and use it in lots of places. Some tests might not want it to be cached though. Another even generalized possibility is to extend Ming's identity map. It currently indexes objects by
_idonly, but we could make it do lookups by any unique key(s) for a given model (e.g.url_prefixforNeighborhood).allura:db/6388
There are a few performance & configuration improvements in this branch, but none of the particular areas mentioned above are addressed. Most of the work in this branch is a script to have a standard benchmark of call counts that can be run for any git revision (can't go earlier than the creation of the script though).
Run the main script to get current call counts, and to see specific calls
allura/scripts/perf$ ./call_count.py -vUse the shell wrapper to create a CSV file with multiple commits recorded (suitable for graphing in a spreadsheet app). E.g.:
allura/scripts/perf$ ./call_count_walk_git.sh bdde98d..HEADFor integration with Jenkins, we should be able to run
call_count.py --data-file /some/permanent/location.csvand hook that up to https://wiki.jenkins-ci.org/display/JENKINS/Plot+Plugin