diff --git a/r2/example.ini b/r2/example.ini index 14e3d91ee1..94350c3577 100644 --- a/r2/example.ini +++ b/r2/example.ini @@ -230,8 +230,6 @@ uncompressedJS = true sqlprinting = false # directory to write cProfile stats dumps to (disabled if not set) profile_directory = -# template names to record render timings for -timed_templates = Reddit, Link, Comment, LinkListing, NestedListing, SubredditTopBar ############################################ PLUGINS diff --git a/r2/r2/lib/app_globals.py b/r2/r2/lib/app_globals.py index d3ee7c279e..af61fc1bc0 100644 --- a/r2/r2/lib/app_globals.py +++ b/r2/r2/lib/app_globals.py @@ -280,7 +280,6 @@ class Globals(object): 'offsite_subdomains', 'TRAFFIC_LOG_HOSTS', 'exempt_login_user_agents', - 'timed_templates', 'autoexpand_media_types', 'multi_icons', 'hide_subscribers_srs', diff --git a/r2/r2/lib/wrapped.pyx b/r2/r2/lib/wrapped.pyx index a52cc4c3e1..58c8a77094 100644 --- a/r2/r2/lib/wrapped.pyx +++ b/r2/r2/lib/wrapped.pyx @@ -189,31 +189,19 @@ class Templated(object): """ from filters import unsafe from pylons import tmpl_context as c - from pylons import app_globals as g - - if self.render_class_name in g.timed_templates: - timer = g.stats.get_timer('render.%s.nocache' % - self.render_class_name, - publish=False) - timer.start() - else: - timer = None - # the style has to default to the global render style - # fetch template template = self.template(style) - if timer: timer.intermediate('template') - # store the global render style (since child templates) + + # store the global render style (child templates might override it) render_style = c.render_style c.render_style = style - # render the template - res = template.render(thing = self) - if timer: timer.intermediate('render') + + res = template.render(thing=self) if not isinstance(res, StringTemplate): res = StringTemplate(res) + # reset the global render style c.render_style = render_style - if timer: timer.stop() return res def _render(self, style, **kwargs):