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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use trace_branch monitoring for Scrutineer #3781

Open
Zac-HD opened this issue Nov 4, 2023 · 1 comment
Open

Use trace_branch monitoring for Scrutineer #3781

Zac-HD opened this issue Nov 4, 2023 · 1 comment
Labels
enhancement it's not broken, but we want it to be better internals Stuff that only Hypothesis devs should ever see performance go faster! use less memory!

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Nov 4, 2023

In #3776 (comment), we decided to use the trace_line monitoring feature in order to ship a big speedup as soon as possible - and any users on Python 3.12 are now benefiting from that decision 馃榿

Conceptually though, we should probably use the trace_branch monitor, and return DISABLE to minimize overhead by tracing each branch only once. This should be pretty easy to implement on the tracing side.

I think it might also require some changes to the data structure and display logic to get compatible analyses and reporting; and depending on how that goes maybe also some test changes. For example, I have no idea how it'll handle multi-part conditionals, or ternary statements, etc. when we're not just using physical lines anymore.

#3551 discusses some related improvements to Scrutineer's reporting; they can be done in either order but ideally not in parallel.

@Zac-HD Zac-HD added enhancement it's not broken, but we want it to be better performance go faster! use less memory! internals Stuff that only Hypothesis devs should ever see labels Nov 4, 2023
@Zac-HD
Copy link
Member Author

Zac-HD commented Dec 4, 2023

Note that #3797 implies we'll sometimes want to collect line coverage (for observability), branch coverage (for scrutineer), and even at times both. I think this is actually pretty easy to support, and we can add .branches and .lines properties to the tracer to expose the data. And the performance is so much better!

@Zac-HD Zac-HD mentioned this issue May 18, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement it's not broken, but we want it to be better internals Stuff that only Hypothesis devs should ever see performance go faster! use less memory!
Projects
None yet
Development

No branches or pull requests

1 participant