Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
622458f2
Commit
622458f2
authored
Apr 20, 2018
by
Samuel GAIST
Browse files
[scripts][benchmark] Fix print statements
parent
134601e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/scripts/benchmark.py
View file @
622458f2
...
...
@@ -13,7 +13,7 @@ import zmq
prefix
=
pkg_resources
.
resource_filename
(
__name__
,
'../test/prefix'
)
print
prefix
print
(
prefix
)
...
...
@@ -25,7 +25,7 @@ class CustomDataSource(DataSource):
self
.
dataformat
=
dataformat
self
.
file
=
open
(
'benchmark.data'
,
'rb'
)
self
.
unpack
=
True
def
next
(
self
):
self
.
file
.
seek
(
0
)
packed
=
self
.
file
.
read
()
...
...
@@ -40,7 +40,7 @@ class CustomDataSource(DataSource):
self
.
current
+=
1
return
result
def
hasMoreData
(
self
):
return
self
.
current
<
self
.
nb_data_units
...
...
@@ -63,7 +63,7 @@ def main():
data_source
=
CustomDataSource
(
10000
,
dataformat
)
print
'Nb Data units: %d'
%
data_source
.
nb_data_units
print
(
'Nb Data units: %d'
%
data_source
.
nb_data_units
)
t1
=
time
.
time
()
...
...
@@ -72,7 +72,7 @@ def main():
t2
=
time
.
time
()
print
'Datasource (unpack): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
print
(
'Datasource (unpack): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
)
data_source
.
reset
()
...
...
@@ -88,7 +88,7 @@ def main():
t2
=
time
.
time
()
print
'Datasource (packed): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
print
(
'Datasource (packed): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
)
data_source
.
reset
()
...
...
@@ -123,7 +123,7 @@ def main():
t2
=
time
.
time
()
print
'Input (packed): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
print
(
'Input (packed): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
)
data_source
.
reset
()
...
...
@@ -169,7 +169,7 @@ def main():
t2
=
time
.
time
()
print
'Remote (unpack): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
print
(
'Remote (unpack): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
)
data_source
.
reset
()
...
...
@@ -186,6 +186,6 @@ def main():
t2
=
time
.
time
()
print
'Remote (packed): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
print
(
'Remote (packed): %.3fs (%.3fms/unit)'
%
(
t2
-
t1
,
(
t2
-
t1
)
*
1000.0
/
data_source
.
nb_data_units
)
)
data_source
.
reset
()
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