aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2016-12-01 17:04:58 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2016-12-01 17:04:58 -0800
commit170dc2f98fed7b75543896e581f41afaa6fa5cd1 (patch)
tree7a9e14c8113608f936324e3fbbe08f4adaa387ad
parentechangelog2: Start to PEP8 strict pythonify. (diff)
downloadmastermirror-scripts-170dc2f98fed7b75543896e581f41afaa6fa5cd1.tar.gz
mastermirror-scripts-170dc2f98fed7b75543896e581f41afaa6fa5cd1.tar.bz2
mastermirror-scripts-170dc2f98fed7b75543896e581f41afaa6fa5cd1.zip
echangelog2: timing data.
git-log: 16.853194 seconds split-commits: 5.570222 seconds write-changelogs: 12.775131 seconds TOTAL: 35.198888 seconds. If we convert git-log to stream data into split-commits, we can probably shave the 5.5 seconds off. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xegenchangelog2.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/egenchangelog2.py b/egenchangelog2.py
index 5ce453a..74d788a 100755
--- a/egenchangelog2.py
+++ b/egenchangelog2.py
@@ -79,6 +79,7 @@ git_log_command = ['git',
#git_log_command += ['-n', '100']
# TODO: convert this into a stream
+# http://stackoverflow.com/questions/18809524/how-to-read-a-big-binary-file-and-split-its-content-by-some-marker
def get_commits_buffer(last_commit='HEAD', first_commit=None, opts=argparse.Namespace()):
buf = None
if opts.read_git_log_data is not None:
@@ -98,6 +99,8 @@ def get_commits_buffer(last_commit='HEAD', first_commit=None, opts=argparse.Name
return buf
+# TODO: convert to using a stream instead of a buffer.
+# http://stackoverflow.com/questions/18809524/how-to-read-a-big-binary-file-and-split-its-content-by-some-marker
class CommitGenerator(object):
def __init__(self, buf, opts=argparse.Namespace()):
self.buf = buf