- **status**: in-progress --> review
- **Comment**:

Closed #721. `ib/7824`


Some timings of neighborhood lookup. First hit - after server restart.

Before cache:

~~~~~
08:35:55,716 INFO  [allura.controllers.root] TIME: 14.0540599823 ms
08:35:57,142 INFO  [allura.controllers.root] TIME: 1.22499465942 ms
08:35:57,209 INFO  [allura.controllers.root] TIME: 0.859022140503 ms
~~~~~

After cache:

~~~~~
08:47:57,925 INFO  [allura.controllers.root] TIME: 14.1131877899 ms
08:47:58,719 INFO  [allura.controllers.root] TIME: 0.0700950622559 ms
08:47:59,622 INFO  [allura.controllers.root] TIME: 0.0560283660889 ms
~~~~~


**QA:**

- add `neighborhood.cache.duration = 60` to config
- go to `/adobe/admin/`, make sure you see 'Adobe' at the top of the page
- `mongo pyforge`
- `db.neighborhood.update({'url_prefix': '/adobe/'}, {'$set': {'name': 'Adobe 
1'}})`
- refresh page, make sure you still see cached neighborhood name
- wait a minure, refresh page again, make sure neighborhood name is updated
- make sure other neighborhoods work and 404 page is shown when appropriate



---

** [tickets:#7824] Cache neighborhood record**

**Status:** review
**Milestone:** unreleased
**Labels:** performance sf-current 42cc 
**Created:** Tue Feb 03, 2015 09:35 PM UTC by Dave Brondsema
**Last Updated:** Wed Feb 04, 2015 06:00 PM UTC
**Owner:** Igor Bondarenko

Every single request hits `RootController.__init__` and does a neighborhood 
lookup.  Neighborhoods don't change very often so this could be cached 
in-memory for a short time.  I think the duration should be configurable and 
default to 0 (particularly so development is easy).  Based on some performance 
monitoring I did, this may save up to 15% of time spent in a simple request 
(smaller relative % on more complex pages)


---

Sent from forge-allura.apache.org because [email protected] is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to