Skip to content

Conversation

knakatasf
Copy link
Contributor

@knakatasf knakatasf commented Oct 3, 2025

Scope & Purpose

  • ShortestPathExecutor holds 2 builder objects: _sourceBuilder and _targetBuilder. Refactored them to be supervised by adding SupervisedBuffer.

  • [Future work] _pathBuilder is a BuilderLeaser. This should be counted manually or by implementing supervised BuilderLeaser.

  • 💩 Bugfix

  • 🍕 New feature

  • 🔥 Performance improvement

  • 🔨 Refactoring/simplification

Checklist

  • Tests
    • Regression tests
    • C++ Unit tests
    • integration tests
    • resilience tests
  • 📖 CHANGELOG entry made
  • 📚 documentation written (release notes, API changes, ...)
  • Backports
    • Backport for 3.12.0: (Please link PR)
    • Backport for 3.11: (Please link PR)
    • Backport for 3.10: (Please link PR)

Related Information

(Please reference tickets / specification / other PRs etc)

  • Docs PR:
  • Enterprise PR:
  • GitHub issue / Jira ticket:
  • Design document:

@cla-bot cla-bot bot added the cla-signed label Oct 3, 2025
@knakatasf knakatasf changed the title Add ResourceMonitor to ShortestPathExecutorInfos; Refactor _sourceBui… [BTS-2203] Add ResourceMonitor to ShortestPathExecutorInfos Oct 3, 2025
_pathLength(0),
_sourceBuilder{},
_targetBuilder{} {
_sourceBuilder(std::make_shared<velocypack::SupervisedBuffer>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't the supervised buffer be built on the stack as _sourceBuilder is a class member, is gonna linger there, and no one's gonna steal the buffer from it?

Copy link
Member

Choose a reason for hiding this comment

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

It can, however the original does a make_shared buffer by itself so this is same ballpark.

This also comes with the downside that we need to put supervised buffer as include in the header.

Copy link
Contributor

Choose a reason for hiding this comment

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

I brought back the include in the header because the other file is .tpp and has no includes

_targetBuilder{} {
_sourceBuilder(std::make_shared<velocypack::SupervisedBuffer>(
infos.resourceMonitor())),
_targetBuilder(std::make_shared<velocypack::SupervisedBuffer>(
Copy link
Contributor

Choose a reason for hiding this comment

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

same for this one

Copy link
Member

@mchacki mchacki left a comment

Choose a reason for hiding this comment

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

Slight change, please move the include into cpp file.
Otherwise LGTM!

_pathLength(0),
_sourceBuilder{},
_targetBuilder{} {
_sourceBuilder(std::make_shared<velocypack::SupervisedBuffer>(
Copy link
Member

Choose a reason for hiding this comment

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

It can, however the original does a make_shared buffer by itself so this is same ballpark.

This also comes with the downside that we need to put supervised buffer as include in the header.

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