Skip to content

Memory optimization: Pack boolean values under delta pointer#3814

Merged
andrejtonev merged 5 commits intomasterfrom
packed_ptr
Feb 23, 2026
Merged

Memory optimization: Pack boolean values under delta pointer#3814
andrejtonev merged 5 commits intomasterfrom
packed_ptr

Conversation

@andrejtonev
Copy link
Copy Markdown
Contributor

@andrejtonev andrejtonev commented Feb 20, 2026

Using the lower 3bits in Delta* to store boolean values.
Delta is 8B aligned, so we are guaranteed the lower 3 bits will be 0.
Saves 8B in Vertex and Edge structures.

@andrejtonev andrejtonev added this to the mg-v3.9.0 milestone Feb 20, 2026
@andrejtonev andrejtonev self-assigned this Feb 20, 2026
@andrejtonev andrejtonev added Code improvements CI -build=coverage -test=core Run coverage build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=debug -test=integration Run debug build and integration tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=release -test=stress Run release build and stress tests on push CI -build=release -test=benchmark Run release build and benchmark on push lower-TCO CI -build=malloc -test=build Run malloc build on push CI -build=coverage -test=clang_tidy labels Feb 20, 2026
Copy link
Copy Markdown
Contributor

@colinbarry colinbarry left a comment

Choose a reason for hiding this comment

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

Approved. A few notes below, but nothing that should stop delivery.

@sonarqubecloud
Copy link
Copy Markdown

@andrejtonev andrejtonev added this pull request to the merge queue Feb 23, 2026
@imilinovic
Copy link
Copy Markdown
Contributor

bugbot run

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Merged via the queue into master with commit 5022587 Feb 23, 2026
41 checks passed
@andrejtonev andrejtonev deleted the packed_ptr branch February 23, 2026 14:07
@andrejtonev
Copy link
Copy Markdown
Contributor Author

andrejtonev commented Feb 24, 2026

Tracking

  • [Link to Epic/Issue]

Standard development

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite)

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • What has changed? What does it mean for a user? What should a user do with it? [#{{PR_number}}]({{link to the PR}})
    • Introduced PackedPtr, which in turn changed the Vertex and Edge layout, which freed up 8B per object. User will see a lower memory footprint without any performance degradation. #3814
  • Vertex/Edge size update documentation#1540
    • Is back linked to this development PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI -build=coverage -test=clang_tidy CI -build=coverage -test=core Run coverage build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=debug -test=integration Run debug build and integration tests on push CI -build=malloc -test=build Run malloc build on push CI -build=release -test=benchmark Run release build and benchmark on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=release -test=stress Run release build and stress tests on push Code improvements Docs needed Docs needed lower-TCO

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants