cleanup(libsinsp): optimize dynamic_table storage#2923
cleanup(libsinsp): optimize dynamic_table storage#2923gnosek wants to merge 19 commits intofalcosecurity:masterfrom
Conversation
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This is a constexpr variant of typeinfo::of which only returns the type_id, not the whole typeinfo object Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnosek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2923 +/- ##
==========================================
- Coverage 74.96% 74.90% -0.07%
==========================================
Files 296 297 +1
Lines 31472 31496 +24
Branches 4977 4979 +2
==========================================
- Hits 23594 23593 -1
- Misses 7878 7903 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ekoops
left a comment
There was a problem hiding this comment.
Great improvement! Overall looks great, but could you please squash some commits? Like the replace typeinfo with raw ... ones?
irozzo-1A
left a comment
There was a problem hiding this comment.
LGTM, I spotted a potential issue but I'm not sure it's relevant
| dynamic_field_value& operator=(dynamic_field_value&& rhs) noexcept { | ||
| m_type = rhs.m_type; | ||
| m_data = rhs.m_data; |
There was a problem hiding this comment.
If the dynamic_field_value already owns a string, we should free it before assigning isn't it?
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?
What this PR does / why we need it:
This PR does two things. Sadly, they're intertwined enough that it's simpler to submit them in the same PR.
The things are:
dynamic_field_value, which is little more than ass_plugin_state_data(used directly to interact with the table API) and ass_plugin_state_typemarker to indicate which variant of the data is currently active. This also introducesborrowed_state_data, which is going to be used a lot more in upcoming PRs as the representation of data being exposed to the table API by the built in tables.This avoids an allocation for every single dynamic field value (which is pointer-sized anyway; strings still get their own allocation for the actual data).
type_infoclass. This has a few uses:SS_PLUGIN_ST_*value for a particular type. This can be replaced with the type_id directlydynamic_field_value.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: