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.
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.