﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27625	Make Settings avoid repeat getattr calls	Adam Johnson	Adam Johnson	"In [https://speakerdeck.com/carljm/instagram-under-the-hood Carl Meyer's talk at DUTH] on Instagram he noted a small 'hack' that add been added to their codebase to speed up all their requests: caching the first result of settings accesses in the outer `LazySettings` object's `__dict__` with a post-setup hook like:

{{{
for key in dir(settings):
    settings.__dict__[key] = getattr(settings, key)
}}}

`LazySettings` itself could do this caching in its own `__dict__` to give great speed to all! It can also be done in a way that is tested to interact better with other parts of Django, such as `override_settings`.
"	Cleanup/optimization	closed	Core (Other)	1.10	Normal	fixed		me@… carl@…	Ready for checkin	1	0	0	0	0	0
