Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
b6a830d8
Commit
b6a830d8
authored
Oct 13, 2017
by
Kirill Smelkov
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X switch cpu benchmarks to go format
parent
94d79c29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
go/neo/t/neotest
go/neo/t/neotest
+2
-1
go/neo/t/tsha1.go
go/neo/t/tsha1.go
+6
-1
go/neo/t/tsha1.py
go/neo/t/tsha1.py
+4
-1
No files found.
go/neo/t/neotest
View file @
b6a830d8
...
...
@@ -727,7 +727,8 @@ nrunpar() {
# bench_cpu - microbenchmark CPU
bench_cpu
()
{
nrun sh
-c
"python -m test.pystone |tail -1"
nrun sh
-c
"python -m test.pystone |tail -1 |sed -e
\
\"
s|^This machine benchmarks at
\(
[0-9]
\+\)
pystones/second
$|
Benchmarkpystone/
`
hostname
`
1
\1
pystone/s|
\"
"
nrun ./tsha1.py 1024
nrun ./tsha1_go 1024
...
...
go/neo/t/tsha1.go
View file @
b6a830d8
...
...
@@ -62,5 +62,10 @@ func main() {
tend
:=
time
.
Now
()
δt
:=
tend
.
Sub
(
tstart
)
fmt
.
Printf
(
"sha1(%dB) ~= %s x=tsha1.go
\n
"
,
blksize
,
δt
/
time
.
Duration
(
n
))
hostname
,
err
:=
os
.
Hostname
()
if
err
!=
nil
{
hostname
=
"?"
}
fmt
.
Printf
(
"Benchmarksha1/%s/go/%dB %d
\t
%.3f µs/op
\n
"
,
hostname
,
blksize
,
n
,
float64
(
δt
)
/
float64
(
n
)
/
float64
(
time
.
Microsecond
))
}
go/neo/t/tsha1.py
View file @
b6a830d8
...
...
@@ -25,6 +25,7 @@ from __future__ import print_function
import
sys
import
hashlib
from
time
import
time
import
socket
def
main
():
blksize
=
int
(
sys
.
argv
[
1
])
...
...
@@ -45,7 +46,9 @@ def main():
tend
=
time
()
dt
=
tend
-
tstart
print
(
'sha1(%dB) ~= %.1fμs x=tsha1.py'
%
(
blksize
,
dt
*
1E6
/
n
))
# hostname generally != fqdn[0] XXX clarify/refine
hostname
=
socket
.
getfqdn
().
split
(
'.'
)[
0
]
print
(
'Benchmarksha1/%s/py/%dB %d
\
t
%.3f µs/op'
%
(
hostname
,
blksize
,
n
,
dt
*
1E6
/
n
))
if
__name__
==
'__main__'
:
main
()
Kirill Smelkov
@kirr
mentioned in commit
a60c472c
·
Jul 12, 2018
mentioned in commit
a60c472c
mentioned in commit a60c472c76da315f918afeb06f994c8610cf7c84
Toggle commit list
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