Skip to content
New issue

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

plot.py does not support output generated with --benchmark_repetitions=X #4

Open
vlovich opened this issue Oct 30, 2020 · 4 comments
Open

Comments

@vlovich
Copy link

vlovich commented Oct 30, 2020

py.exe google_benchmark_plot/plot.py -f test.csv -r 'BM_MyTest<uint8_t>'

results in

Traceback (most recent call last):
  File "google_benchmark_plot/plot.py", line 123, in <module>
    main()
  File "google_benchmark_plot/plot.py", line 118, in main
    label_groups[label][args.metric] /= baseline
  File "C:\Python38\lib\site-packages\pandas\core\ops\methods.py", line 101, in f
    result.reindex_like(self, copy=False), verify_is_copy=False
  File "C:\Python38\lib\site-packages\pandas\core\generic.py", line 3856, in reindex_like
    return self.reindex(**d)
  File "C:\Python38\lib\site-packages\pandas\core\series.py", line 4399, in reindex
    return super().reindex(index=index, **kwargs)
  File "C:\Python38\lib\site-packages\pandas\core\generic.py", line 4461, in reindex
    return self._reindex_axes(
  File "C:\Python38\lib\site-packages\pandas\core\generic.py", line 4481, in _reindex_axes
    obj = obj._reindex_with_indexers(
  File "C:\Python38\lib\site-packages\pandas\core\generic.py", line 4524, in _reindex_with_indexers
    new_data = new_data.reindex_indexer(
  File "C:\Python38\lib\site-packages\pandas\core\internals\managers.py", line 1276, in reindex_indexer
    self.axes[axis]._can_reindex(indexer)
  File "C:\Python38\lib\site-packages\pandas\core\indexes\base.py", line 3289, in _can_reindex
    raise ValueError("cannot reindex from a duplicate axis")
ValueError: cannot reindex from a duplicate axis

test.csv contains:

name,iterations,real_time,cpu_time,time_unit,bytes_per_second,items_per_second,label,error_occurred,error_message
"BM_MyTest<uint8_t>/1/0",23578947,39.6876,31.808,ns,,0,,,
"BM_MyTest<uint8_t>/1/0",23578947,32.0808,31.808,ns,,0,,,
"BM_MyTest<uint8_t>/1/0",23578947,30.3521,29.1574,ns,,0,,,
"BM_MyTest<uint8_t>/1/0_mean",3,34.0402,30.9245,ns,,0,,,
"BM_MyTest<uint8_t>/1/0_median",3,32.0808,31.808,ns,,0,,,
"BM_MyTest<uint8_t>/1/0_stddev",3,4.96659,1.53036,ns,,0,,,
"BM_MyTest<uint8_t>/1/0_",3,4.96659,1.53036,ns,,0,,,
"BM_MyTest<uint8_t>_BigO",,3.06507,3.02076,N,,,,,
@lakshayg
Copy link
Owner

Thanks for reporting, I'll take a look

@lakshayg
Copy link
Owner

lakshayg commented Nov 9, 2020

The error is due to the first three lines in the output

"BM_MyTest<uint8_t>/1/0",23578947,39.6876,31.808,ns,,0,,,
"BM_MyTest<uint8_t>/1/0",23578947,32.0808,31.808,ns,,0,,,
"BM_MyTest<uint8_t>/1/0",23578947,30.3521,29.1574,ns,,0,,,

All of these have the same test name. I wonder why is that the case

@chouquette
Copy link

Hi,

This is the case when a test is run with --benchmark_repetitions=X in which case I suppose the value to use would be the mean or median

@lakshayg
Copy link
Owner

@chouquette That makes sense. I think it might make sense to have some sort of a reduce flag which describes the behaviour when there are multiple lines with the same name. The reduce flag can take any of {min, max, median, mean}. Feel free to make a PR or post other ideas.

@lakshayg lakshayg changed the title BigO in output causes failure to plot plot.py does not support output generated with --benchmark_repetitions=X Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants