[Piglit] [PATCH v2 0/5] Add support for JSON backend to use a streaming writer

Dylan Baker dylan at pnwbakers.com
Thu Sep 1 19:01:08 UTC 2016


This series adds support for using jsonstreams, which is a package I
wrote for writing JSON documents using a streaming API. The goal is to
reduce the memory usage of piglit, especially while writing out the
final result file.

This is a purely optional dependency, and those with fast machines with
a lot of RAM might not care, but machines with memory constraints this
should help a lot. I measured on my machine, writing out the final
document requires about 4Gb of RAM without this series, which was the
single largest consumer of RAM on the system. With this series applied
and using jsonstreams I saw the overhead reduced to a few Mbs. It also,
for me, reduced the runtime of large runs (like running the quick
profile) by a few seconds, though for small runs it increased it by a
tiny bit.

Jsonstreams is available through pypi (the python package index) and
can be installed through pip (pip install --user jsonstreams) and
supports the same versions of python that piglit itself does (2.7, 3.3,
3.4, and 3.5 currently). Archlinux users can install packages from the
aur called python-jsonstreams and python2-jsonstreams.

Dylan Baker (5):
  unittests: Fix shared data for backends.
  framework: Add support for jsonstreams
  tox: add a streams target.
  unittests: Fix JSON schema test to pass time_elapsed
  unittests: don't require totals section in schema

 .travis.yml                                       |   8 +-
 appveyor.yml                                      |   8 +-
 framework/backends/json.py                        | 111 ++++++++++-----
 tox.ini                                           |   6 +-
 unittests/framework/backends/schema/piglit-8.json |   2 +-
 unittests/framework/backends/shared.py            |   7 +-
 unittests/framework/backends/test_json.py         |   3 +-
 7 files changed, 97 insertions(+), 48 deletions(-)

-- 
git-series 0.8.10


More information about the Piglit mailing list