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

Store benchmark metadata data in results.json #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adriencaccia
Copy link
Member

@adriencaccia adriencaccia commented Jan 9, 2025

Add results.json file containing benchmark metadata for all instruments, and update the valgrind trigger to contain all the metadata.

Copy link

codspeed-hq bot commented Jan 9, 2025

CodSpeed Performance Report

Merging #63 will create unknown performance changes

Comparing cod-429-update-pytest-codspeed-to-store-benchmark-metadata-data-in (HEAD, commit 1ad4aa9) with master (BASE, da9270d)

Summary

🆕 100 new benchmarks
⁉️ 47 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
⁉️ test_iir_filter_process 31.2 µs N/A N/A
⁉️ test_iir_filter_set_coefficients[a_coeffs0-b_coeffs0] 15.5 µs N/A N/A
⁉️ test_make_allpass 36.6 µs N/A N/A
⁉️ test_make_bandpass 37.2 µs N/A N/A
⁉️ test_make_highpass 37.9 µs N/A N/A
⁉️ test_make_highshelf 42.5 µs N/A N/A
⁉️ test_make_lowpass 46.6 µs N/A N/A
⁉️ test_make_lowshelf 42.5 µs N/A N/A
⁉️ test_make_peak 40.1 µs N/A N/A
⁉️ test_color[graph0-3] 81 µs N/A N/A
⁉️ test_combination_lists[0-0] 23.2 µs N/A N/A
⁉️ test_combination_lists[4-2] 30.1 µs N/A N/A
⁉️ test_combination_lists[5-4] 28 µs N/A N/A
⁉️ test_combination_sum[candidates0-8] 43.2 µs N/A N/A
⁉️ test_depth_first_search[4] 83.5 µs N/A N/A
⁉️ test_generate_all_combinations[0-0] 18.4 µs N/A N/A
⁉️ test_generate_all_combinations[4-2] 36.5 µs N/A N/A
⁉️ test_generate_all_combinations[5-4] 42.1 µs N/A N/A
⁉️ test_generate_all_permutations[sequence0] 104.4 µs N/A N/A
⁉️ test_generate_all_permutations[sequence1] 104 µs N/A N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@adriencaccia adriencaccia force-pushed the cod-429-update-pytest-codspeed-to-store-benchmark-metadata-data-in branch from fbae262 to 1ad4aa9 Compare January 13, 2025 17:23
@adriencaccia adriencaccia changed the title cod 429 update pytest codspeed to store benchmark metadata data in Store benchmark metadata data in results.json Jan 16, 2025
.vscode/settings.json Show resolved Hide resolved
src/pytest_codspeed/benchmark.py Show resolved Hide resolved
tests/conftest.py Show resolved Hide resolved
Comment on lines +53 to +80
@property
def display_name(self) -> str:
if len(self.args) == 0:
args_str = ""
else:
arg_blocks = []
for i, (arg_name, arg_value) in enumerate(zip(self.args_names, self.args)):
arg_blocks.append(arg_to_str(arg_value, arg_name, i))
args_str = f"[{'-'.join(arg_blocks)}]"

return f"{self.name}{args_str}"

def to_json_string(self) -> str:
return json.dumps(
self.__dict__, default=vars, separators=(",", ":"), sort_keys=True
)


def arg_to_str(arg: Any, arg_name: str, index: int) -> str:
if type(arg) in [int, float, str]:
return str(arg)
if (
arg is not None
and type(arg) not in [list, dict, tuple]
and hasattr(arg, "__str__")
):
return str(arg)
return f"{arg_name}{index}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging, we need to make sure we know the difference with the display name computation from pytest itself (and the potential impact)


config: BenchmarkConfig
stats: BenchmarkStats
class WalltimeBenchmark(Benchmark):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it essential to inherit here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That way we do not have to define the properties twice

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant It's weird to inherit from a metadata class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants