Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
17298b2d
Commit
17298b2d
authored
Mar 29, 2017
by
Ray Glover
Committed by
Dominic Hamon
Mar 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python 2/3 compatibility (#361)
* [tools] python 2/3 support * update authors/contributors
parent
0dbcdf56
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
AUTHORS
AUTHORS
+1
-0
CONTRIBUTORS
CONTRIBUTORS
+1
-0
compare_bench.py
tools/compare_bench.py
+1
-1
report.py
tools/gbench/report.py
+1
-1
util.py
tools/gbench/util.py
+11
-11
No files found.
AUTHORS
View file @
17298b2d
...
...
@@ -18,6 +18,7 @@ Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Google Inc.
International Business Machines Corporation
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
...
...
CONTRIBUTORS
View file @
17298b2d
...
...
@@ -48,6 +48,7 @@ Pascal Leroy <phl@google.com>
Paul Redmond <paul.redmond@gmail.com>
Pierre Phaneuf <pphaneuf@google.com>
Radoslav Yovchev <radoslav.tm@gmail.com>
Ray Glover <ray.glover@uk.ibm.com>
Shuo Chen <chenshuo@chenshuo.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Tobias Ulvgård <tobias.ulvgard@dirac.se>
...
...
tools/compare_bench.py
View file @
17298b2d
...
...
@@ -59,7 +59,7 @@ def main():
json1
=
gbench
.
util
.
run_or_load_benchmark
(
test1
,
benchmark_options
)
json2
=
gbench
.
util
.
run_or_load_benchmark
(
test2
,
benchmark_options
)
output_lines
=
gbench
.
report
.
generate_difference_report
(
json1
,
json2
)
print
'Comparing
%
s to
%
s'
%
(
test1
,
test2
)
print
(
'Comparing
%
s to
%
s'
%
(
test1
,
test2
)
)
for
ln
in
output_lines
:
print
(
ln
)
...
...
tools/gbench/report.py
View file @
17298b2d
...
...
@@ -132,7 +132,7 @@ class TestReportDifference(unittest.TestCase):
json1
,
json2
=
self
.
load_results
()
output_lines_with_header
=
generate_difference_report
(
json1
,
json2
,
use_color
=
False
)
output_lines
=
output_lines_with_header
[
2
:]
print
"
\n
"
.
join
(
output_lines_with_header
)
print
(
"
\n
"
.
join
(
output_lines_with_header
)
)
self
.
assertEqual
(
len
(
output_lines
),
len
(
expect_lines
))
for
i
in
xrange
(
0
,
len
(
output_lines
)):
parts
=
[
x
for
x
in
output_lines
[
i
]
.
split
(
' '
)
if
x
]
...
...
tools/gbench/util.py
View file @
17298b2d
...
...
@@ -20,21 +20,21 @@ def is_executable_file(filename):
"""
if
not
os
.
path
.
isfile
(
filename
):
return
False
with
open
(
filename
,
'r
'
)
as
f
:
with
open
(
filename
,
mode
=
'rb
'
)
as
f
:
magic_bytes
=
f
.
read
(
_num_magic_bytes
)
if
sys
.
platform
==
'darwin'
:
return
magic_bytes
in
[
'
\xfe\xed\xfa\xce
'
,
# MH_MAGIC
'
\xce\xfa\xed\xfe
'
,
# MH_CIGAM
'
\xfe\xed\xfa\xcf
'
,
# MH_MAGIC_64
'
\xcf\xfa\xed\xfe
'
,
# MH_CIGAM_64
'
\xca\xfe\xba\xbe
'
,
# FAT_MAGIC
'
\xbe\xba\xfe\xca
'
# FAT_CIGAM
b
'
\xfe\xed\xfa\xce
'
,
# MH_MAGIC
b
'
\xce\xfa\xed\xfe
'
,
# MH_CIGAM
b
'
\xfe\xed\xfa\xcf
'
,
# MH_MAGIC_64
b
'
\xcf\xfa\xed\xfe
'
,
# MH_CIGAM_64
b
'
\xca\xfe\xba\xbe
'
,
# FAT_MAGIC
b
'
\xbe\xba\xfe\xca
'
# FAT_CIGAM
]
elif
sys
.
platform
.
startswith
(
'win'
):
return
magic_bytes
==
'MZ'
return
magic_bytes
==
b
'MZ'
else
:
return
magic_bytes
==
'
\x7F
ELF'
return
magic_bytes
==
b
'
\x7F
ELF'
def
is_json_file
(
filename
):
...
...
@@ -68,7 +68,7 @@ def classify_input_file(filename):
elif
is_json_file
(
filename
):
ftype
=
IT_JSON
else
:
err_msg
=
"'
%
s' does not name a valid benchmark executable or JSON file"
err_msg
=
"'
%
s' does not name a valid benchmark executable or JSON file"
%
filename
return
ftype
,
err_msg
...
...
@@ -80,7 +80,7 @@ def check_input_file(filename):
"""
ftype
,
msg
=
classify_input_file
(
filename
)
if
ftype
==
IT_Invalid
:
print
"Invalid input file:
%
s"
%
msg
print
(
"Invalid input file:
%
s"
%
msg
)
sys
.
exit
(
1
)
return
ftype
...
...
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