Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
37eb25f1
Commit
37eb25f1
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the len() calculation into the stop watch class
parent
6de4ee54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/Products/ZCatalog/Catalog.py
src/Products/ZCatalog/Catalog.py
+3
-3
src/Products/ZCatalog/report.py
src/Products/ZCatalog/report.py
+6
-2
No files found.
src/Products/ZCatalog/Catalog.py
View file @
37eb25f1
...
...
@@ -528,14 +528,14 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# once we don't need to support the "return everything" case
# anymore
if
r
is
not
None
and
not
r
:
cr
.
split
(
i
,
0
)
cr
.
split
(
i
,
None
)
return
LazyCat
([])
cr
.
split
(
i
,
len
(
r
)
)
cr
.
split
(
i
,
r
)
w
,
rs
=
weightedIntersection
(
rs
,
r
)
if
not
rs
:
break
else
:
cr
.
split
(
i
,
0
)
cr
.
split
(
i
,
None
)
cr
.
stop
()
...
...
src/Products/ZCatalog/report.py
View file @
37eb25f1
...
...
@@ -117,7 +117,7 @@ class StopWatch(object):
self
.
init
()
self
.
start_time
=
time
.
time
()
def
split
(
self
,
label
,
result
_length
=
None
):
def
split
(
self
,
label
,
result
=
None
):
current
=
time
.
time
()
start_time
,
stop_time
=
self
.
interim
.
get
(
label
,
(
None
,
None
))
...
...
@@ -125,8 +125,12 @@ class StopWatch(object):
self
.
interim
[
label
]
=
(
current
,
None
)
return
length
=
0
if
result
is
not
None
:
# TODO: calculating the length can be expensive
length
=
len
(
result
)
self
.
interim
[
label
]
=
(
start_time
,
current
)
self
.
res
.
append
((
label
,
current
-
start_time
,
result_
length
))
self
.
res
.
append
((
label
,
current
-
start_time
,
length
))
def
stop
(
self
):
self
.
end_time
=
time
.
time
()
...
...
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