Fix more performance issues found by cppcheck#51
Closed
dalgaaf wants to merge 61 commits intoceph:masterfrom
dalgaaf:wip-da-sca-cppcheck-performance-2
Closed
Fix more performance issues found by cppcheck#51dalgaaf wants to merge 61 commits intoceph:masterfrom dalgaaf:wip-da-sca-cppcheck-performance-2
dalgaaf wants to merge 61 commits intoceph:masterfrom
dalgaaf:wip-da-sca-cppcheck-performance-2
Conversation
Fix issues found by cppcheck: [src/auth/cephx/CephxProtocol.h:469]: (performance) Function parameter 'key' should be passed by reference. Pass CryptoKey by reference as already done in encode_encrypt(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). warning from cppcheck was: [src/mds/journal.cc:470]: (performance) Possible inefficient checking for 'old_inodes' emptiness. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). warning from cppcheck was: [src/mon/AuthMonitor.cc:210]: (performance) Possible inefficient checking for 'pending_auth' emptiness. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Using empty() in this case makes the code more logical. warning from cppcheck was: [src/mon/OSDMonitor.h:59]: (performance) Possible inefficient checking for 'reporters' emptiness. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). warning from cppcheck was: [src/mon/Monitor.cc:487]: (performance) Possible inefficient checking for 'initial_members' emptiness. [src/mon/Monitor.cc:1361]: (performance) Possible inefficient checking for 'timecheck_skews' emptiness. [src/mon/Monitor.cc:2302]: (performance) Possible inefficient checking for 'timecheck_waiting' emptiness. [src/mon/Monitor.cc:2547]: (performance) Possible inefficient checking for 'timecheck_waiting' emptiness. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). This replaces also some size() >=/== checks. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). This replaces also some size() >=/== checks. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). This replaces also some size() >=/== checks. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck: [src/osdc/Objecter.cc:989] -> [src/osdc/Objecter.cc:992]: (performance) Variable 'check_for_latest_map' is reassigned a value before the old one has been used. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). This way the code is more logical. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck: [src/rgw/rgw_admin.cc:710] -> [src/rgw/rgw_admin.cc:714]: (performance) Variable 'ret' is reassigned a value before the old one has been used. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck: [src/rgw/rgw_log.cc:340]: (performance) Passing the result of c_str() to a function that takes std::string as argument no. 4 is slow and redundant. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
…iness Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
…tiness Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() instead of '!size()' for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck: [src/rgw/rgw_rest_swift.cc:770]: (performance) Passing the result of c_str() to a function that takes std::string as argument no. 1 is slow and redundant. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of 'size()' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of 'size()' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Print some more results to fix issue found by cppcheck: [src/scratchtoolpp.cc:111] -> [src/scratchtoolpp.cc:114]: (performance) Variable 'r' is reassigned a value before the old one has been used. [src/scratchtoolpp.cc:207] -> [src/scratchtoolpp.cc:208]: (performance) Variable 'r' is reassigned a value before the old one has been used. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of 'size() > 0' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of 'size()' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of size() to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() instead of '!size()' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() instead of '!size()' and "size() == 0" to check for emptiness for performance reasons and since it's more logical. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() instead of size() to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of size() to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use !empty() instead of size() to check for non-emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() instead of 'size() == 0' or 'size() < 1' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix some smaller performance related issues from cppcheck due to "Variable '..xy..' is reassigned a value before the old one has been used. Fix some indention. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Member
|
Merged with a few modifications as of ffda2ea. More discussion on the mailing list. |
Contributor
Author
|
@gregsfortytwo: Thanks. AFAICS everything is in except the gtest patch. Correct me if I'm wrong. |
XinzeChi
pushed a commit
to XinzeChi/ceph
that referenced
this pull request
Jan 29, 2016
…-opt ReplicatedPG:: find_object_context clear extra creation (head,snapdir)
ddiss
pushed a commit
to ddiss/ceph
that referenced
this pull request
Oct 25, 2016
port civetweb https fix Reviewed-by: Nathan Cutler <ncutler@suse.com>
ricardoasmarques
added a commit
to ricardoasmarques/ceph
that referenced
this pull request
Jan 30, 2018
mgr/dashboard_v2: Fix bug in AuthRequired decorator
lixiaoy1
added a commit
to lixiaoy1/ceph
that referenced
this pull request
Apr 8, 2020
…o 'wip-librbd-rwl-3' Resolve "Performance degraded on branch wip-librbd-rwl-3" Closes ceph#51 See merge request sdpeters/ceph-rwl!33
14 tasks
irq0
pushed a commit
to irq0/ceph
that referenced
this pull request
Oct 14, 2022
rgw/sfs: ensure sqlite user ops hold required locks
tobias-urdin
pushed a commit
to tobias-urdin/ceph
that referenced
this pull request
Aug 2, 2023
Fall back when nuking buckets Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
athanatos
pushed a commit
to athanatos/ceph
that referenced
this pull request
Feb 14, 2025
server: delayed tag calculation as a template parameter Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here some more patches to fix performance issues found by cppcheck. This should now cover - together with wip-da-sca-cppcheck-performance - the following issues: