Mercurial > piecrust2
comparison piecrust/commands/builtin/baking.py @ 1017:3c669bb9498e
bake: Don't cheat when profiling.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 29 Nov 2017 20:41:09 -0800 |
parents | 8adc27285d93 |
children | 54159951d97a |
comparison
equal
deleted
inserted
replaced
1016:c4cfbbeed72e | 1017:3c669bb9498e |
---|---|
73 iter_start_time = time.perf_counter() | 73 iter_start_time = time.perf_counter() |
74 if num_iter > 1: | 74 if num_iter > 1: |
75 import gc | 75 import gc |
76 gc.collect() | 76 gc.collect() |
77 logger.info("---- %d/%d ----" % (i + 1, num_iter)) | 77 logger.info("---- %d/%d ----" % (i + 1, num_iter)) |
78 # Don't cheat -- the app instance caches a bunch of stuff | |
79 # so we need to create a fresh one. | |
80 ctx.app = ctx.appfactory.create() | |
78 | 81 |
79 try: | 82 try: |
80 records = self._doBake(ctx, out_dir) | 83 records = self._doBake(ctx, out_dir) |
81 except Exception as ex: | 84 except Exception as ex: |
82 if ctx.app.debug: | 85 if ctx.app.debug: |