Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
grumpy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
grumpy
Commits
00679fe8
Commit
00679fe8
authored
Jan 21, 2017
by
Brian Atkinson
Committed by
Dylan Trotter
Jan 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bm_call_method and bm_call_simple from the python benchmark suite. (#188)
parent
d52d231b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
277 additions
and
0 deletions
+277
-0
benchmarks/bm_call_method.py
benchmarks/bm_call_method.py
+138
-0
benchmarks/bm_call_simple.py
benchmarks/bm_call_simple.py
+139
-0
No files found.
benchmarks/bm_call_method.py
0 → 100644
View file @
00679fe8
"""Microbenchmark for method call overhead.
This measures simple method calls that are predictable, do not use varargs or
kwargs, and do not use tuple unpacking.
Taken from:
https://github.com/python/performance/blob/9b8d859/performance/benchmarks/bm_call_method.py
"""
import
weetest
class
Foo
(
object
):
def
foo
(
self
,
a
,
b
,
c
,
d
):
# 20 calls
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
self
.
bar
(
a
,
b
,
c
)
def
bar
(
self
,
a
,
b
,
c
):
# 20 calls
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
self
.
baz
(
a
,
b
)
def
baz
(
self
,
a
,
b
):
# 20 calls
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
self
.
quux
(
a
)
def
quux
(
self
,
a
):
# 20 calls
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
self
.
qux
()
def
qux
(
self
):
pass
def
BenchmarkCallMethod
(
b
):
f
=
Foo
()
for
_
in
xrange
(
b
.
N
):
# 20 calls
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
f
.
foo
(
1
,
2
,
3
,
4
)
if
__name__
==
'__main__'
:
weetest
.
RunBenchmarks
()
benchmarks/bm_call_simple.py
0 → 100644
View file @
00679fe8
"""Microbenchmark for function call overhead.
This measures simple function calls that are not methods, do not use varargs or
kwargs, and do not use tuple unpacking.
Taken from:
https://github.com/python/performance/blob/9b8d859/performance/benchmarks/bm_call_simple.py
"""
import
weetest
def
foo
(
a
,
b
,
c
,
d
):
# 20 calls
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
bar
(
a
,
b
,
c
)
def
bar
(
a
,
b
,
c
):
# 20 calls
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
baz
(
a
,
b
)
def
baz
(
a
,
b
):
# 20 calls
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
quux
(
a
)
def
quux
(
a
):
# 20 calls
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
qux
()
def
qux
():
pass
def
BenchmarkCallSimple
(
b
):
for
_
in
xrange
(
b
.
N
):
# 20 calls
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
foo
(
1
,
2
,
3
,
4
)
if
__name__
==
'__main__'
:
weetest
.
RunBenchmarks
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment