Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Store benchmark metadata data in results.json #63

Draft
wants to merge 4 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 Instrumentation Performance Report

Merging #63 will create unknown performance changes

Comparing cod-429-update-pytest-codspeed-to-store-benchmark-metadata-data-in (ef62849) with master (d137431)

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 µs N/A N/A
⁉️ test_iir_filter_set_coefficients[a_coeffs0-b_coeffs0] 15.6 µs N/A N/A
⁉️ test_make_allpass 36.7 µs N/A N/A
⁉️ test_make_bandpass 37.3 µs N/A N/A
⁉️ test_make_highpass 38 µs N/A N/A
⁉️ test_make_highshelf 42.4 µs N/A N/A
⁉️ test_make_lowpass 46.5 µs N/A N/A
⁉️ test_make_lowshelf 42.5 µs N/A N/A
⁉️ test_make_peak 40.3 µs N/A N/A
⁉️ test_color[graph0-3] 80.9 µs N/A N/A
⁉️ test_combination_lists[0-0] 23.1 µ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.3 µs N/A N/A
⁉️ test_depth_first_search[4] 83.3 µs N/A N/A
⁉️ test_generate_all_combinations[0-0] 18.3 µs N/A N/A
⁉️ test_generate_all_combinations[4-2] 36.4 µs N/A N/A
⁉️ test_generate_all_combinations[5-4] 42.2 µs N/A N/A
⁉️ test_generate_all_permutations[sequence0] 104.3 µs N/A N/A
⁉️ test_generate_all_permutations[sequence1] 103.8 µ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
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

Copy link
Member Author

Choose a reason for hiding this comment

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

Seen together, let's do composition instead of inheritance, by having a new field benchmark_metadata: BenchmarkMetadata

@adriencaccia adriencaccia force-pushed the cod-429-update-pytest-codspeed-to-store-benchmark-metadata-data-in branch from 1ad4aa9 to ef62849 Compare January 24, 2025 14:40
@art049 art049 marked this pull request as draft January 28, 2025 17:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants