diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-06-03 16:49:25 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-06-03 16:49:25 +0300 |
commit | 90911ae6112debd620904362b452dbdca04c0e44 (patch) | |
tree | 72e68ded9d9aabc51d267abe5b445adfac9a136e | |
parent | 57513d8a3a52bbadef11fd1b5bc52833f72bfca1 (diff) | |
download | obnam-benchmarks-90911ae6112debd620904362b452dbdca04c0e44.tar.gz |
Use libYAML's CSafeDumper and CSafeLoader, for speed
-rw-r--r-- | obbenchlib/htmlgen.py | 2 | ||||
-rw-r--r-- | obbenchlib/result.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/obbenchlib/htmlgen.py b/obbenchlib/htmlgen.py index c0bc06f..778be9c 100644 --- a/obbenchlib/htmlgen.py +++ b/obbenchlib/htmlgen.py @@ -74,7 +74,7 @@ class HtmlGenerator(object): for i, filename in enumerate(filenames): print 'Loading', filename, i+1, 'of', len(filenames) with open(filename) as f: - yield yaml.safe_load(f) + yield yaml.load(f, Loader=yaml.CSafeLoader) def write_file(self, relative_path, text): filename = os.path.join(self.htmldir, relative_path) diff --git a/obbenchlib/result.py b/obbenchlib/result.py index 8ac24b8..d782680 100644 --- a/obbenchlib/result.py +++ b/obbenchlib/result.py @@ -54,4 +54,4 @@ class Result(object): } filename = os.path.join(dirname, '{}.yaml'.format(self._result_id)) with open(filename, 'w') as f: - yaml.safe_dump(o, stream=f) + yaml.dump(o, stream=f, Dumper=yaml.CSafeDumper) |