From 0d0f8866c2fb3764bf7c54647b54cb72e041fb4e Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Mon, 22 May 2023 21:55:32 +0800 Subject: [PATCH] Document new ijson.benchmark module Signed-off-by: Rodrigo Tobar --- CHANGELOG.md | 6 ++++++ README.rst | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fca88c..7e81ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ * Removed support for Python 2.7 and 3.4, 3.5+ is still supported. +* Distribute the existing `benchmark.py` script + as ``ijson.benchmark``. + The module is an improved version of the script, + supporting #iterations for a given function invocation, + multiple input files, + and more. ## [3.2.3] diff --git a/README.rst b/README.rst index 2522853..7a2e11d 100644 --- a/README.rst +++ b/README.rst @@ -175,6 +175,28 @@ For example:: Using ``-h/--help`` will show all available options. +.. _benchmarking: + +Benchmarking +------------ + +A command line utility is included with ijson +to help benchmarking the different methods offered by the package. +It offers some built-in example inputs +that try to mimic different scenarios, +but more importantly it also supports user-provided inputs. +You can also specify which backends to time, +number of iterations, +and more. + +The tool is available by running the ``ijson.benchmark`` module. +For example:: + + $> python -m ijson.benchmark my/json/file.json -m items -p values.item + +Using ``-h/--help`` will show all available options. + + ``bytes``/``str`` support ------------------------- @@ -493,6 +515,10 @@ out of ijson: might show better performance. See options_ for details. +The benchmarking_ tool should help +with trying some of these options +and observing their effect on your input files. + .. _faq: