Skip to content

Misc optimizations - #60175

Merged
MaxKellermann merged 2 commits into
ceph:mainfrom
MaxKellermann:misc_optimizations
Feb 12, 2025
Merged

MaxKellermann merged 2 commits into
ceph:mainfrom
MaxKellermann:misc_optimizations

Conversation

@MaxKellermann

Copy link
Copy Markdown
Member

Various micro-optimizations.

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)

@MaxKellermann
MaxKellermann requested a review from a team as a code owner October 7, 2024 21:17

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have no objections to these changes except that please split these into multiple PRs by component. It's much easier to QA/review that way.

@MaxKellermann

Copy link
Copy Markdown
Member Author

Will do. One PR per top-level directory?

Can you see why that one unit test fails? I tried building the unit tests, but I get strange build failures - I will eventually fix them, but since I've seen lots of bogus CI failures, I thought maybe this one may be bogus as well...

@ronen-fr

ronen-fr commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

A minor note: the erase() fixes seem to be more than optimizations. Might be worth mentioning in the title and labels as fixes (unless I'm missing something)

@MaxKellermann

Copy link
Copy Markdown
Member Author

A minor note: the erase() fixes seem to be more than optimizations. Might be worth mentioning in the title and labels as fixes (unless I'm missing something)

The old code was not wrong; previously, the iterators were incremented manually before calling erase(). That is guaranteed to work, but it's just not good style. This doesn't fix an actual bug, and the program behavior doesn't change. The code just gets simpler and better (for some subjective meaning of "better").

@ronen-fr

ronen-fr commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

The old code was not wrong; previously, the iterators were incremented manually before calling erase()

Hmm.. The line I saw said
observers.erase(o++);

So if 'observers' is a vector - that's a bug. Indeed - it is not a vector, so I stand corrected.

@MaxKellermann

Copy link
Copy Markdown
Member Author

I created 4 new PRs with almost all of the patches here. When these are merged, I'll rebase this PR and then we see what still remains here.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@MaxKellermann

Copy link
Copy Markdown
Member Author

Rebased and dropped the patches that are already in the other two remaining open PRs.

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 <[email protected]>
For some containers, `empty()` is faster than `size()`.

Signed-off-by: Max Kellermann <[email protected]>
@MaxKellermann

Copy link
Copy Markdown
Member Author

@batrick is this trimmed-down PR acceptable or do you want me to split it further?

@MaxKellermann

Copy link
Copy Markdown
Member Author

@batrick?

1 similar comment
@MaxKellermann

Copy link
Copy Markdown
Member Author

@batrick?

@batrick

batrick commented Jan 6, 2025

Copy link
Copy Markdown
Member

retest this please

@ronen-fr

ronen-fr commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

@yuriw

yuriw commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

jenkins test docs

@yuriw

yuriw commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

@ljflores ljflores removed the needs-qa label Feb 10, 2025
@MaxKellermann

Copy link
Copy Markdown
Member Author

All CI tests have succeeded, only "ceph-pr-docs" which has a bogus failure. Thanks @yuriw and @ljflores.
I think that means it can finally be merged - and I'll try my new merge privileges that were granted to me this week for the first time.

@MaxKellermann
MaxKellermann merged commit 1b47950 into ceph:main Feb 12, 2025
@MaxKellermann
MaxKellermann deleted the misc_optimizations branch February 12, 2025 16:12
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.

5 participants