Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions tools/sizediff
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ class Comparison:
def readSizes(path):
sizes = []
lines = open(path).readlines()
command = None
for i in range(len(lines)):
if not lines[i].strip().startswith('code '):
continue
# found a size header
code, data, bss, flash, ram = map(int, lines[i+1].replace("|", "").split())
command = lines[i-1].strip()
sizes.append({
'command': command,
'flash': flash,
'ram': ram
})
if lines[i].strip().startswith('tinygo build'):
command = lines[i].strip()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we be more explicit and check for lines[i].strip().startswith('tinygo build') to set command ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's probably better, I've updated the PR. (I see there are some '-xesppie' is not a recognized feature for this target (ignoring feature) "commands" which aren't the actual command either).

elif lines[i].strip().startswith('code '):
# found a size header
code, data, bss, flash, ram = map(int, lines[i+1].replace("|", "").split())
sizes.append({
'command': command,
'flash': flash,
'ram': ram
})
command = None # make sure we don't accidentally miss a 'tinygo build' line
return sizes

def main():
Expand Down
Loading