-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvement for smt list #311
Conversation
I hadn't been aware of I can't comment on the performance implications of writing to a file in Regardless, if the purpose of |
This is correct. The reason this slows things down is not the writing to file; it is that the current implementation ends up calling
I agree with this. The |
Concerning the structure of this PR, I would prefer to have a separate PR for each step. I suggest renaming this pull request to something like "Make bash completion optional" and opening a new one for filtering records (cf #309). |
@@ -424,11 +424,13 @@ def list(argv): # add 'report' and 'log' as aliases | |||
default='text', | |||
help="FMT can be 'text' (default), 'html', 'json', 'latex' or 'shell'.") | |||
parser.add_argument('-r', '--reverse', action="store_true", dest="reverse", default=False, | |||
help="list records in reverse order (default: newest first)"), | |||
help="list records in reverse order (default: newest first)") | |||
parser.add_argument('-w', '--write', action="store_true", dest="write", default=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option should be named something like --enable-bash-completion
.
Firstly, if this PR is about making bash completion optional then the command line switch should have a different name to reflect this. (Oh never mind, I just saw that @apdavison already suggested this in a line comment.) However, making bash completion optional never was the intention of this PR - it was meant to improve performance. I'm not completely opposed to making it optional, but I think we should avoid introducing lots of options just because we can. If it's cheap in terms of performance to keep the bash completion functionality then why have a switch to disable it? (Again, I'm not sure if it really is cheap, but it sounds to me like the performance-critical parts are unrelated to actually writing to the file |
maxalbert is right. Let's keep it enabled. There is a way for fast writing to a file. Sorry for re-renaming the title. |
I definitely see a speed improvement with @babsey's latest change. In a project with 432 records, Generally speaking, 45 seconds for a simple Btw, if |
@maxalbert: I agree on all points. @babsey: please could you squash the commits? Once that's done I can merge this PR, or I could leave it open for further work. Let me know what you would prefer. |
I also agree. I wrote a new method Futhermore, I made the next step for improved speed of plain smt list command. This should be a very fast. The question is where I can implement these code lines. I am open-minded for your suggestions. @apdavison: I never squashed commits but if you agree on these steps. I will try to squash these commits |
@babsey I haven't looked at the latest changes yet, but in terms of how to squash commits: I personally really like using git's interactive rebase for this. If you run
This will open up an editor which will show you all the commits on your curent branch that are on top of Once you have squashed the commits you will need to push the branch to Github again:
The |
fast writing for bash completion writeline to write with open(..) as f add project method get_labels alternative print for plain smt list correct code because of failed travis test correct code because of failed travis test correct code because of failed travis test add method "records" to MockRecordStore quick filter record labels by tags add tags argument to MockRecordStore.records
…o per_impr_CLI
Performance improvement for smt list
cf discussion on #309 and #310
The concept of this PR is to improve performance for
smt list
.I would like to make this PR step by step. After merging I will continue writing codes for this PR.
The first step is to stop the constant writing in file.
Next steps will be limiting amount of records for print or filtering by date, script file etc...
Which of these steps do you desire?