Repository navigation
Move the benchmark entry point to numpy_groupies.benchmarks - #125
Merged
Merged
Conversation
added 6 commits
October 16, 2026 13:18
- generic.py becomes the package __init__, __main__.py makes python -m numpy_groupies.benchmarks work - drop simple.py: its nine functions, its 100k data set and its group-and-loop reference are covered by the module and by test_compare - measure the numpy group-and-loop path as a _grouploop implementation behind --grouploop
- single run: rows go to stdout as they are measured, no summary after them - several runs: a counter on stderr, the merged table on stdout once - the live rows carry the column header - end a piped run quietly on a closed reader
- measure numpy and numba by default, everything else behind its own flag - add --all for the optional columns and build the table from COLUMN_ORDER - put purepy behind --purepy - drop the live rows when the measurement is repeated - move the column explanations into --help, leave the docs pointing at it
- rerun the full table with --ufunc --numbagg --pandas --runs=3 - rerun the sort sweep with --sort --runs=3 - state the new column order in both tables - restate the ratios in the prose from the new numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
simple.py is gone
It printed three usage examples, checked nine functions against a group-and-loop reference and timed those nine over 100,000 values. All three are covered elsewhere: the examples are in the README, the comparison is
test_compare.py(over every implementation pair and far more functions), and the timing is this module's table (40 functions,--size 1e5gives the same data set). It also still went through theaggregate_np/aggregate_pyaliases.The one thing worth keeping was its
np-grouploopcolumn: the same numpy implementation with its fast path disabled, i.e. what afuncthe implementation does not recognise costs.generic.pystill carried the helper for it, unused since the rework - it is now_grouploop.pyand an opt-in column, in line with_pandas.pyand_ufunc.py:----where no per-group callable can express the function (the cumulatives, the argreductions,sort);arbitraryis a custom callable and lands on the group-loop path by itself, which is why numpy and grouploop agree there.The entry point
generic.pyis the package__init__.pyand a five-line__main__.pyruns it, becausepython -mon a package executes__main__.pyand not the__init__.py:The
--helpheader, the README and the two commands indocs/benchmarks.mdfollow the new name; the--grouploopcolumn is documented next to the other opt-in ones.