Skip to content

Commit e3f4e31

Browse files
committed
Fix CodSpeed attribute parsing and Python formatting
Signed-off-by: Connor Tsui <[email protected]>
1 parent e7dcb02 commit e3f4e31

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

‎benchmarks/bench-support/src/lib.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ pub fn cpu_features(attr: TokenStream, item: TokenStream) -> TokenStream {
106106
// benchmark by leaf name and arguments, so without the suffix every leg would report
107107
// into one `words_gather_dispatch[65536]` series instead of one series each.
108108
let name = function.sig.ident.to_string();
109-
let separator = if existing.is_empty() {
110-
quote!()
111-
} else {
112-
quote!(,)
109+
let separator = match existing.clone().into_iter().last() {
110+
None => quote!(),
111+
Some(proc_macro2::TokenTree::Punct(punct)) if punct.as_char() == ',' => quote!(),
112+
Some(_) => quote!(,),
113113
};
114114
let bench_path = bench.path().clone();
115115
bench.meta = syn::parse_quote! {

‎vortex-python/benchmark/test_filter.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111

1212
@pytest.fixture
13-
def filter_vxf(
14-
request: pytest.FixtureRequest, vxf: vx.VortexFile, codspeed_simulation: bool
15-
) -> vx.VortexFile:
13+
def filter_vxf(request: pytest.FixtureRequest, vxf: vx.VortexFile, codspeed_simulation: bool) -> vx.VortexFile:
1614
assert isinstance(request.node, pytest.Function)
1715
if codspeed_simulation and request.node.callspec.params["vxf"] == "int":
1816
pytest.skip("System calls vary inside these filtered scans under simulation.")

‎vortex-python/benchmark/test_scalar_at.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010

1111
@pytest.fixture
12-
def scalar_vxf(
13-
request: pytest.FixtureRequest, vxf: vx.VortexFile, codspeed_simulation: bool
14-
) -> vx.VortexFile:
12+
def scalar_vxf(request: pytest.FixtureRequest, vxf: vx.VortexFile, codspeed_simulation: bool) -> vx.VortexFile:
1513
assert isinstance(request.node, pytest.Function)
1614
if codspeed_simulation and request.node.callspec.params["vxf"] == "int":
1715
pytest.skip("Reactor polling varies inside these scalar scans under simulation.")

0 commit comments

Comments
 (0)