Skip to content

Update SourceLink to use only 16 bytes #61

Description

@madbaron

Reminder from #49

paulgessinger
19 hours ago
SourceLink uses SBO to try to avoid heap-allocations. If you can fit the concrete payload inside the buffer, that's most efficient. The easiest way is to only store a pointer or an index inside SourceLink, but that obviously doesn't always work.

It's something to check / keep in mind though.

Member
@madbaron
madbaron
10 hours ago
I set out Claude to explain me what this comment was about..
It checked against the stack we build on (ACTS main, default ACTS_SOURCELINK_SBO_SIZE=16). ACTSTracking::SourceLink is 24 bytes (GeometryIdentifier 8 + index 8 + edm4hep::TrackerHit handle 8), so it exceeds the 16-byte buffer and currently heap-allocates on every wrap. The geometryId is used directly as the multiset key and in findSeeds, so it has to stay, but the edm4hep::TrackerHit handle could be recovered via the index rather than stored — that would bring it to 16 bytes and back into the in-place case.
Given I only understand this superficially, I'd keep this for a follow-up PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions