Skip to content

Instantly share code, notes, and snippets.

@eglaysher
Created October 15, 2010 19:05
Show Gist options
  • Save eglaysher/628743 to your computer and use it in GitHub Desktop.
Save eglaysher/628743 to your computer and use it in GitHub Desktop.
Script used to measure differences in size of object files
#!/usr/bin/python
#
# Script used to measure differences in size of object files
#
# $ make -j15 chrome
# $ find out/Debug/ -name "*.a" | xargs ls -s > before.txt
# --- CHANGE CHANGE CHANGE ---
# $ make -j15 chrome
# $ find out/Debug/ -name "*.a" | xargs ls -s > after.txt
# $ diff -u before.txt after.txt | ./count_sizediff.py
import sys
total = 0
for line in sys.stdin:
size_str = line[1:7]
if line[1] == '+' or line[1] == '-':
continue
elif line[0] == '-':
total += int(size_str)
elif line[0] == '+':
total -= int(size_str)
print total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment