Skip to content
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

cleanup: improve perf populate_cmdline #2138

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

Andreagit97
Copy link
Member

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area libsinsp

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

improve perf populate_cmdline

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Copy link

Perf diff from master - unit tests

     6.44%     +1.28%  [.] sinsp::next
     9.99%     -0.88%  [.] sinsp_parser::reset
     4.82%     -0.77%  [.] sinsp_evt::get_type
     2.00%     -0.73%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     0.53%     +0.70%  [.] sinsp_evt::get_ts
     1.42%     -0.63%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::find
     3.49%     +0.57%  [.] gzfile_read
     0.21%     +0.54%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_fdinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_fdinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     1.69%     -0.49%  [.] sinsp_parser::parse_context_switch
     1.18%     -0.47%  [.] sinsp_threadinfo::~sinsp_threadinfo

Heap diff from master - unit tests

peak heap memory consumption: -320.03K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: -288.62K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            +0.0132         +0.0132           147           149           147           149
BM_sinsp_split_median                                          +0.0123         +0.0123           147           149           147           149
BM_sinsp_split_stddev                                          -0.3901         -0.3899             2             1             2             1
BM_sinsp_split_cv                                              -0.3981         -0.3978             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0005         +0.0005            57            57            57            57
BM_sinsp_concatenate_paths_relative_path_median                -0.0046         -0.0046            57            56            57            56
BM_sinsp_concatenate_paths_relative_path_stddev                +3.2846         +3.2928             0             1             0             1
BM_sinsp_concatenate_paths_relative_path_cv                    +3.2827         +3.2908             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0434         -0.0435            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0413         -0.0414            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.8547         -0.8542             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.8481         -0.8476             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0048         -0.0048            56            56            56            56
BM_sinsp_concatenate_paths_absolute_path_median                -0.0043         -0.0043            56            56            56            56
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.3646         +0.3631             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.3711         +0.3696             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0039         -0.0039           396           394           396           394
BM_sinsp_split_container_image_median                          -0.0063         -0.0062           396           394           396           394
BM_sinsp_split_container_image_stddev                          +0.1199         +0.1180             1             2             1             2
BM_sinsp_split_container_image_cv                              +0.1243         +0.1224             0             0             0             0

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 74.45%. Comparing base (701e991) to head (72062f5).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/threadinfo.cpp 63.63% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2138      +/-   ##
==========================================
- Coverage   74.46%   74.45%   -0.01%     
==========================================
  Files         254      254              
  Lines       33340    33347       +7     
  Branches     5724     5710      -14     
==========================================
+ Hits        24827    24830       +3     
+ Misses       8508     8486      -22     
- Partials        5       31      +26     
Flag Coverage Δ
libsinsp 74.45% <63.63%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poiana
Copy link
Contributor

poiana commented Oct 30, 2024

LGTM label has been added.

Git tree hash: 7665a1b01afcd287beeebe3a156f7199d61be827

Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Oct 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 4d04cad into falcosecurity:master Oct 31, 2024
47 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants