comparison piecrust/app.py @ 419:6801ad5aa1d4

internal: Optimize page segments rendering. * Don't create the page data up-front, since it's wasted work if the page has cached rendered segments. * Add a performance counter for data building.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 20 Jun 2015 23:25:38 -0700
parents 0e9a94b7fdfa
children 456db44dcc53
comparison
equal deleted inserted replaced
418:d5724c0c8f1a 419:6801ad5aa1d4
413 if self.env is None: 413 if self.env is None:
414 self.env = StandardEnvironment() 414 self.env = StandardEnvironment()
415 self.env.initialize(self) 415 self.env.initialize(self)
416 self.env.registerTimer('SiteConfigLoad') 416 self.env.registerTimer('SiteConfigLoad')
417 self.env.registerTimer('PageLoad') 417 self.env.registerTimer('PageLoad')
418 self.env.registerTimer("PageDataBuild")
418 419
419 @cached_property 420 @cached_property
420 def config(self): 421 def config(self):
421 logger.debug("Creating site configuration...") 422 logger.debug("Creating site configuration...")
422 start_time = time.perf_counter() 423 start_time = time.perf_counter()