GNOME Bugzilla – Bug 689689
argument vector filling improvement proposal
Last modified: 2013-03-19 16:57:46 UTC
Created attachment 230742 [details] [review] argument vector filling improvement Here is a small patch replacing one by one argument pushing into the arguments vector in an handwritten 'for' loop by its builtin range constructor counterpart. It's a really small improvement, but it will remove an handwritten loop, and may also improve gparted startup speed from a few microsecond.
*** Bug 689662 has been marked as a duplicate of this bug. ***
Thank you Dupuy for creating this bug report, posting your patch, and marking the duplicate report as a duplicate. With the next release of GParted (0.14.1) planned for December 12, 2012, there is a freeze in place for new patches. There are, of course, exceptions for emergency bug fixes, but for this report we will need to wait until after the release date to consider this enhancement. Out of curiousity, did you benchmark GParted with and without the patch to see if there is any change in performance?
Thank you Curtis. No I didn't. There is very likely to be one but it is likely to be insignificant, moreover that gparted is usually launched with no arguments or no significant number. It's more a matter of "good practice" rather than a significant improvement (and since I used gparted to discover what a real world gtkmm application is, and probably others will too, let's it be a "good practices" place). I'll measure with ctime the improvement of that chunk of code with the old and new version. Btw I discovered the sources are now on a git. I made the patch from the svn repo so the sources are a bit outdated, but the patch applies smoothly on the git repo with a little fuzz, so it shounldn't bother you. Actually my first name is "Mathieu", it seems like I messed up creating my account.
Sorry Mathieu about the confusion in name. It looks like your name is now listed the proper way in Bugzilla. :-) I plan to look at this patch after the release (I do not anticipate any problems with the patch). All patches should cleanly apply to the git repository. You can learn more about GParted development at: http://gparted.org/development.php
Thank you for the patch. Would you be able to make this into a git format patch? http://gparted.org/git.php A patch placed into git format will contain your name, email address, and a comment describing the patch. Otherwise I can look into doing this when I have some time, but I will still need the name and email address for providing you credit for authoring the patch.
Created attachment 231567 [details] [review] argument vector filling improvement - git format same patch - git format
I have made into it a git format patch. Sorry for the inconvenience.
Thank you Mathieu for reformatting the patch. Hopefully you don't mind, but I took the liberty of rewording the comment with the patch to enable linking back from the git commit to the bug report. I have also added you to the AUTHORS file to give you credit for this work. The patch has been committed to the git repository for inclusion in the next release of GParted. The relevant git commit can be viewed at the following link: Argument vector usage improvement (#689689) http://git.gnome.org/browse/gparted/commit/?id=b7393be2684a1868cf97ff436695a9762555cb82
The code change to address this report has been included in GParted 0.15.0 released on March 19, 2013.