We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perfplot.bench()
Consider posting in https://github.com/nschloe/perfplot/discussions for feedback before raising a feature request.
How would you improve perfplot?
Format the time in perfplot.bench() output in a manner similar to timeit module.
timeit
Proposal: Adding a new function:
def format_time(dt: float, precision: int=3): """Formats time to unit. Taken from `timeit` module.""" units = {"nsec": 1e-9, "usec": 1e-6, "msec": 1e-3, "sec": 1.0} scales = [(scale, unit) for unit, scale in units.items()] scales.sort(reverse=True) for scale, unit in scales: if dt >= scale: break return "%.*g %s" % (precision, dt / scale, unit)
Then, formatting it in PerfplotData.__repr__(self)
PerfplotData.__repr__(self)
perfplot/src/perfplot/_main.py
Line 171 in f224a89
- lst = [str(n)] + [str(tt) for tt in t] + lst = [str(n)] + [format_time(tt) for tt in t]
What problem does it solved for you?
Right now the output from perfplot.bench() is not very readable:
Code:
out = perfplot.bench(...) print(out)
Current output:
Overall ---------------------------------------- 100% 0:00:00 Kernels ---------------------------------------- 0% 0:00:02 ┌────┬────────────────────────┬────────────────────────┬────────────────────────┐ │ n │ kernel1 │ kernel2 │ kernel3 │ ├────┼────────────────────────┼────────────────────────┼────────────────────────┤ │ 4 │ 0.00010070000000000001 │ 4.2600000000000005e-05 │ 1.8000000000000001e-06 │ │ 8 │ 0.0002924 │ 0.0006585 │ 7.8e-06 │ │ 16 │ 0.0010366000000000002 │ 0.0052959 │ 4.1e-05 │ └────┴────────────────────────┴────────────────────────┴────────────────────────┘
Proposed output:
Overall ---------------------------------------- 100% 0:00:00 Kernels ---------------------------------------- 0% -:--:-- ┌────┬───────────┬───────────┬───────────┐ │ n │ kernel1 │ kernel2 │ kernel3 │ ├────┼───────────┼───────────┼───────────┤ │ 4 │ 158 usec │ 55.2 usec │ 18.1 usec │ │ 8 │ 386 usec │ 865 usec │ 10.9 usec │ │ 16 │ 1.43 msec │ 10.8 msec │ 57.5 usec │ └────┴───────────┴───────────┴───────────┘
Did I help
If I was able to resolve your problem, consider sponsoring my work on perfplot, or buy me a coffee to say thanks.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider posting in https://github.com/nschloe/perfplot/discussions for feedback before raising a feature request.
How would you improve perfplot?
Format the time in
perfplot.bench()
output in a manner similar totimeit
module.Proposal:
Adding a new function:
Then, formatting it in
PerfplotData.__repr__(self)
perfplot/src/perfplot/_main.py
Line 171 in f224a89
What problem does it solved for you?
Right now the output from
perfplot.bench()
is not very readable:Code:
Current output:
Proposed output:
Did I help
If I was able to resolve your problem, consider sponsoring my work on perfplot, or buy me a coffee to say thanks.
The text was updated successfully, but these errors were encountered: