Created
April 7, 2014 20:32
-
-
Save lmacken/10046905 to your computer and use it in GitHub Desktop.
A script to benchmark GNOME Tracker overhead during an RPM transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How much does tracker affect package installation? | |
# | |
# Average with tracker: 21.754451847076417 | |
# Average without tracker: 21.509078884124754 | |
import os | |
from timeit import Timer | |
cmd = 'sudo dnf reinstall -y kernel-3.13.8-200.fc20.x86_64.rpm' | |
t = Timer(stmt="os.system('%s')" % cmd, setup="import os") | |
i = 10 | |
def run(): | |
results = [t.timeit(1) for _ in range(i)] | |
avg = sum(results) / len(results) | |
return avg | |
os.system('tracker-control --start') | |
avg1 = run() | |
os.system('tracker-control --terminate=all') | |
avg2 = run() | |
print('Average with tracker: %r' % avg1) | |
print('Average without tracker: %r' % avg2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment