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

Unified Diff: tools/eval_gc_nvp.py

Issue 1858573002: [tools] Filter empty categories in GC eval script (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/eval_gc_nvp.py
diff --git a/tools/eval_gc_nvp.py b/tools/eval_gc_nvp.py
index af131f182fc52f71b8b741c43bcba05d60b3bf06..fcb6d8b9a2232ff24b04709d9520df0bd0b61755 100755
--- a/tools/eval_gc_nvp.py
+++ b/tools/eval_gc_nvp.py
@@ -97,6 +97,9 @@ class Category:
return 0.0
return sum(self.values) / len(self.values)
+ def empty(self):
+ return len(self.values) == 0
+
def __str__(self):
if self.csv:
ret = [self.key]
@@ -179,6 +182,9 @@ def main():
for category in categories:
category.process_entry(obj)
+ # Filter out empty categories.
+ categories = [x for x in categories if not x.empty()]
+
if args.rank != "no":
categories = sorted(categories, key=make_key_func(args.rank), reverse=True)
« 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