Skip to content

Commit

Permalink
ci: try fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Sep 19, 2023
1 parent f8bf4b8 commit 2161320
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions benchmarks/_evented.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from dataclasses import dataclass
from typing import ClassVar

from psygnal import SignalGroupDescriptor
try:
from psygnal import SignalGroupDescriptor
except ImportError:
SignalGroupDescriptor = None


def _get_dataclass(type_: str, evented: bool) -> type:
Expand Down Expand Up @@ -96,5 +99,7 @@ def attribute_access(num: int = 100_000, repeat: int = 20) -> None:
print(f"{type_} (with events): {w_events / wo_events:.3f}x slower")


if __name__ == "__main__":
if SignalGroupDescriptor is None:
print("SignalGroupDescriptor not found, skipping evented benchmarks")
elif __name__ == "__main__":
attribute_access()

0 comments on commit 2161320

Please sign in to comment.