Skip to content

Commit 0ece3ff

Browse files
committed
feat: add bench of various python noop
1 parent a4ea7f9 commit 0ece3ff

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
def noop_pass():
2+
pass
3+
4+
5+
def noop_ellipsis(): ...
6+
7+
8+
def noop_lambda():
9+
(lambda: None)()
10+
11+
12+
def test_noop_pass(benchmark):
13+
benchmark(noop_pass)
14+
15+
16+
def test_noop_ellipsis(benchmark):
17+
benchmark(noop_ellipsis)
18+
19+
20+
def test_noop_lambda(benchmark):
21+
benchmark(noop_lambda)
22+
23+
24+
def test_noop_pass_decorated(benchmark):
25+
@benchmark
26+
def _():
27+
noop_pass()
28+
29+
30+
def test_noop_ellipsis_decorated(benchmark):
31+
@benchmark
32+
def _():
33+
noop_ellipsis()
34+
35+
36+
def test_noop_lambda_decorated(benchmark):
37+
@benchmark
38+
def _():
39+
noop_lambda()

0 commit comments

Comments
 (0)