Skip to content

Commit

Permalink
Update packages/SwingSet/misc-tools/computrons-for-deliveries.py
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Gibson <[email protected]>
  • Loading branch information
warner and gibson042 authored Oct 5, 2024
1 parent fe12fee commit 82e2486
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/SwingSet/misc-tools/computrons-for-deliveries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
from collections import defaultdict
from pprint import pprint

# Find all deliveries of a certain type and emit a histogram of how
# many computrons they took. If the delivery is supposed to take
# constant time, this might reveal JS-level growth (e.g. `serialize()`
# taking longer because the data it is working with is growing).
# Given a slogfile argument, emit a CSV for every matching delivery:
# crankNum,computrons
# If the delivery is supposed to take constant time, this might reveal
# JS-level growth (e.g. `serialize()` taking longer because the data it
# is working with is growing).

# You'll need to edit this file to change the selection criteria.

fn = sys.argv[1]
# These match criteria can be changed by hand:
vatID = "v7"
ko = None # "ko258"
method = "serialize"

crankNum = None

print("crankNum,computrons")

crankNum = None

opener = gzip.open if fn.endswith(".gz") else open
with opener(sys.argv[1]) as f:
for line in f:
Expand Down

0 comments on commit 82e2486

Please sign in to comment.