Skip to content

Commit

Permalink
feat: add bench of various python noop
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Sep 17, 2024
1 parent a4ea7f9 commit 0ece3ff
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/benchmarks/test_bench_various_noop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
def noop_pass():
pass


def noop_ellipsis(): ...


def noop_lambda():
(lambda: None)()


def test_noop_pass(benchmark):
benchmark(noop_pass)


def test_noop_ellipsis(benchmark):
benchmark(noop_ellipsis)


def test_noop_lambda(benchmark):
benchmark(noop_lambda)


def test_noop_pass_decorated(benchmark):
@benchmark
def _():
noop_pass()


def test_noop_ellipsis_decorated(benchmark):
@benchmark
def _():
noop_ellipsis()


def test_noop_lambda_decorated(benchmark):
@benchmark
def _():
noop_lambda()

0 comments on commit 0ece3ff

Please sign in to comment.