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

Allow for filtering beyond function names #5

Open
nvzqz opened this issue Oct 6, 2023 · 0 comments
Open

Allow for filtering beyond function names #5

nvzqz opened this issue Oct 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nvzqz
Copy link
Owner

nvzqz commented Oct 6, 2023

Currently, filtering only works up to crate → module → function. Parameters to the function are not considered: generic types, constants, and thread counts.

The following code:

#[divan::bench(
    types = [i32, String],
    consts = [0, 42],
    threads = [1, 2],
)]
fn bench<T, const N: usize>() {}

...produces this output tree structure:

example
╰─ bench
   ├─ i32
   │  ├─ 0
   │  │  ├─ t=1
   │  │  ╰─ t=2
   │  ╰─ 42
   │     ├─ t=1
   │     ╰─ t=2
   ╰─ String
      ├─ 0
      │  ├─ t=1
      │  ╰─ t=2
      ╰─ 42
         ├─ t=1
         ╰─ t=2

However, we can only filter against example::bench. We cannot filter against example::bench::String::42::t=2. I think this is something we should try to support.

We should also consider whether we want benchmark parameters to be treated like namespacing when filtering. Perhaps instead they should be made to look more like Rust code: example::bench::<String, 42>(t=2)? I think the previous format is easier to reason about.

@nvzqz nvzqz added the enhancement New feature or request label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant