Skip to content

common: Various optimizations#60216

Merged
batrick merged 7 commits intoceph:mainfrom
MaxKellermann:common_optimizations
Oct 22, 2024
Merged

common: Various optimizations#60216
batrick merged 7 commits intoceph:mainfrom
MaxKellermann:common_optimizations

Conversation

@MaxKellermann
Copy link
Member

common-specific parts of #60175 (split upon @batrick's request)

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

@github-actions github-actions bot added the common label Oct 9, 2024
@batrick
Copy link
Member

batrick commented Oct 9, 2024

/home/jenkins-build/build/workspace/ceph-pull-requests/src/common/config.cc:136:7: error: no matching constructor for initialization of 'Option'
      Option(name, Option::TYPE_STR, Option::LEVEL_ADVANCED));
      ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, the Boost intrusive containers enable the
`constant_time_size` option which adds overhead to each modification
for tracking the size in a field.  We don't need that.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
This eliminates one temporary copy per call.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
@MaxKellermann
Copy link
Member Author

Whoops, sorry, this happened when I moved the patch over to the "main" branch (same with the build failure in the other PR). I guess I forgot to build "main" after the move. (We're using Reef, so I develop and test everything on that branch and only move it over for upstream submission.)

The machine code is both smaller and faster.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
@MaxKellermann MaxKellermann requested a review from a team as a code owner October 9, 2024 21:12
@markhpc markhpc changed the title Common optimizations src/common: Common optimizations Oct 10, 2024
@markhpc markhpc changed the title src/common: Common optimizations common: Various optimizations Oct 10, 2024
@batrick
Copy link
Member

batrick commented Oct 19, 2024

This PR is under test in https://tracker.ceph.com/issues/68629.

batrick added a commit to batrick/ceph that referenced this pull request Oct 19, 2024
* refs/pull/60216/head:
	common/options: pass name as rvalue reference
	common/config: use libfmt to build strings
	common/config: use emplace_back() instead of push_back()
	common/HeartbeatMap: pass name as rvalue reference
	common/config_obs_mgr: use the erase() return value
	common/SloppyCRCMap: use the erase() return value
	common: disable `boost::intrusive::constant_time_size`
@batrick
Copy link
Member

batrick commented Oct 22, 2024

@batrick batrick merged commit 514ff50 into ceph:main Oct 22, 2024
@MaxKellermann MaxKellermann deleted the common_optimizations branch October 22, 2024 05:09
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.

3 participants