Skip to content

Commit

Permalink
Document new ijson.benchmark module
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Nov 30, 2023
1 parent f2f45e3 commit 0d0f886
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
26 changes: 26 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------------

Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit 0d0f886

Please sign in to comment.