Mercurial > piecrust2
comparison piecrust/baking/worker.py @ 440:32c7c2d219d2
performance: Refactor how data is managed to reduce copying.
* Make use of `collections.abc.Mapping` to better identify things that are
supposed to look like dictionaries.
* Instead of handling "overlay" of data in a dict tree in each different data
object, make all objects `Mapping`s and handle merging at a higher level
with the new `MergedMapping` object.
* Since this new object is read-only, remove the need for deep-copying of
app and page configurations.
* Split data classes into separate modules.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 28 Jun 2015 08:22:39 -0700 |
parents | 21e26ed867b6 |
children | dc8518c51cbe |
comparison
equal
deleted
inserted
replaced
439:c0700c6d9545 | 440:32c7c2d219d2 |
---|---|
196 logger.debug("Loading page: %s" % fac.ref_spec) | 196 logger.debug("Loading page: %s" % fac.ref_spec) |
197 result = LoadJobResult(fac.source.name, fac.path) | 197 result = LoadJobResult(fac.source.name, fac.path) |
198 try: | 198 try: |
199 page = fac.buildPage() | 199 page = fac.buildPage() |
200 page._load() | 200 page._load() |
201 result.config = page.config.get() | 201 result.config = page.config.getAll() |
202 except Exception as ex: | 202 except Exception as ex: |
203 logger.debug("Got loading error. Sending it to master.") | 203 logger.debug("Got loading error. Sending it to master.") |
204 result.errors = _get_errors(ex) | 204 result.errors = _get_errors(ex) |
205 if self.ctx.debug: | 205 if self.ctx.debug: |
206 logger.exception(ex) | 206 logger.exception(ex) |