Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: tools/cygprofile/mergetraces.py

Issue 873003003: Speed up mergetraces.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cygprofile/mergetraces.py
diff --git a/tools/cygprofile/mergetraces.py b/tools/cygprofile/mergetraces.py
index 93a00cacef21fa75c597a5aaed5b85aa3cc1a894..85faf701cec8c8ad0771c54fe63c975e614f0c54 100755
--- a/tools/cygprofile/mergetraces.py
+++ b/tools/cygprofile/mergetraces.py
@@ -101,7 +101,7 @@ def Convert (call_lines, startAddr, endAddr):
list of calls as tuples (sec, usec, pid:tid, callee)
"""
converted_calls = []
- call_addresses = []
+ call_addresses = set()
for fields in call_lines:
secs = int (fields[0])
usecs = int (fields[1])
@@ -111,7 +111,7 @@ def Convert (call_lines, startAddr, endAddr):
if (callee >= startAddr and callee < endAddr
and (not callee in call_addresses)):
converted_calls.append((secs, usecs, fields[2], (callee - startAddr)))
- call_addresses.append(callee)
+ call_addresses.add(callee)
return converted_calls
def Timestamp(trace_entry):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698