Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
ZEO
Commits
b459aaa9
Commit
b459aaa9
authored
May 08, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print mean, min, and max for summary.
Also print # conflicts for each test (appears to be zero).
parent
12dba8b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
src/ZEO/tests/speed.py
src/ZEO/tests/speed.py
+17
-7
No files found.
src/ZEO/tests/speed.py
View file @
b459aaa9
...
@@ -151,6 +151,7 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
...
@@ -151,6 +151,7 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
for
j
in
range
(
nrep
):
for
j
in
range
(
nrep
):
for
r
in
1
,
10
,
100
,
1000
:
for
r
in
1
,
10
,
100
,
1000
:
t
=
time
.
time
()
t
=
time
.
time
()
conflicts
=
0
jar
=
db
.
open
()
jar
=
db
.
open
()
while
1
:
while
1
:
...
@@ -171,7 +172,7 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
...
@@ -171,7 +172,7 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
setattr
(
p
,
str
(
i
),
v
)
setattr
(
p
,
str
(
i
),
v
)
get_transaction
().
commit
()
get_transaction
().
commit
()
except
ConflictError
:
except
ConflictError
:
pass
conflicts
=
conflicts
+
1
else
:
else
:
break
break
jar
.
close
()
jar
.
close
()
...
@@ -179,10 +180,11 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
...
@@ -179,10 +180,11 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
t
=
time
.
time
()
-
t
t
=
time
.
time
()
-
t
if
detailed
:
if
detailed
:
if
threadno
is
None
:
if
threadno
is
None
:
print
"%s
\
t
%s
\
t
%.4f
"
%
(
j
,
r
,
t
)
print
"%s
\
t
%s
\
t
%.4f
\
t
%d"
%
(
j
,
r
,
t
,
conflicts
)
else
:
else
:
print
"%s
\
t
%s
\
t
%.4f
\
t
%d"
%
(
j
,
r
,
t
,
threadno
)
print
"%s
\
t
%s
\
t
%.4f
\
t
%d
\
t
%d"
%
(
j
,
r
,
t
,
conflicts
,
results
[
r
]
=
results
[
r
]
+
t
threadno
)
results
[
r
].
append
((
t
,
conflicts
))
rt
=
d
=
p
=
v
=
None
# release all references
rt
=
d
=
p
=
v
=
None
# release all references
if
minimize
:
if
minimize
:
time
.
sleep
(
3
)
time
.
sleep
(
3
)
...
@@ -238,7 +240,7 @@ def main(args):
...
@@ -238,7 +240,7 @@ def main(args):
cache_deactivate_after
=
6000
,)
cache_deactivate_after
=
6000
,)
print
"Beginning work..."
print
"Beginning work..."
results
=
{
1
:
0
,
10
:
0
,
100
:
0
,
1000
:
0
}
results
=
{
1
:
[],
10
:[],
100
:[],
1000
:[]
}
if
threads
>
1
:
if
threads
>
1
:
import
threading
import
threading
l
=
[
threading
.
Thread
(
target
=
work
,
l
=
[
threading
.
Thread
(
target
=
work
,
...
@@ -259,9 +261,17 @@ def main(args):
...
@@ -259,9 +261,17 @@ def main(args):
if
detailed
:
if
detailed
:
print
'-'
*
24
print
'-'
*
24
print
"num
\
t
mean
\
t
min
\
t
max"
for
r
in
1
,
10
,
100
,
1000
:
for
r
in
1
,
10
,
100
,
1000
:
t
=
results
[
r
]
/
(
nrep
*
threads
)
times
=
[
time
for
time
,
conf
in
results
[
r
]]
print
"mean:
\
t
%s
\
t
%.4f
\
t
%.4f (s/o)"
%
(
r
,
t
,
t
/
r
)
t
=
mean
(
times
)
print
"%d
\
t
%.4f
\
t
%.4f
\
t
%.4f"
%
(
r
,
t
,
min
(
times
),
max
(
times
))
def
mean
(
l
):
tot
=
0
for
v
in
l
:
tot
=
tot
+
v
return
tot
/
len
(
l
)
##def compress(s):
##def compress(s):
## c = zlib.compressobj()
## c = zlib.compressobj()
...
...
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