After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689689 - argument vector filling improvement proposal
argument vector filling improvement proposal
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other All
: Normal enhancement
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
: 689662 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-12-05 10:01 UTC by Mathieu Dupuy
Modified: 2013-03-19 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
argument vector filling improvement (485 bytes, patch)
2012-12-05 10:01 UTC, Mathieu Dupuy
none Details | Review
argument vector filling improvement - git format (780 bytes, patch)
2012-12-14 12:57 UTC, Mathieu Dupuy
none Details | Review

Description Mathieu Dupuy 2012-12-05 10:01:07 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.
Comment 1 Mathieu Dupuy 2012-12-05 15:46:10 UTC
*** Bug 689662 has been marked as a duplicate of this bug. ***
Comment 2 Curtis Gedak 2012-12-06 01:48:00 UTC
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?
Comment 3 Mathieu Dupuy 2012-12-06 11:33:38 UTC
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.
Comment 4 Curtis Gedak 2012-12-06 18:27:42 UTC
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
Comment 5 Curtis Gedak 2012-12-13 21:37:14 UTC
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.
Comment 6 Mathieu Dupuy 2012-12-14 12:57:06 UTC
Created attachment 231567 [details] [review]
argument vector filling improvement - git format

same patch - git format
Comment 7 Mathieu Dupuy 2012-12-14 12:57:57 UTC
I have made into it a git format patch. Sorry for the inconvenience.
Comment 8 Curtis Gedak 2013-01-12 21:22:29 UTC
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
Comment 9 Curtis Gedak 2013-03-19 16:57:46 UTC
The code change to address this report has been included in GParted 0.15.0 released on March 19, 2013.