Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ntuple] outline several definitions from RFieldBase #16510

Merged

Conversation

silverweed
Copy link
Contributor

This Pull request:

moves various definitions outside of RFieldBase for improved readability

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

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

In principle fine, but I think at least for the classes, I'd prefer to move the docstring as well to where the actual code is.

Copy link

github-actions bot commented Sep 23, 2024

Test Results

    14 files      14 suites   3d 13h 5m 58s ⏱️
 2 697 tests  2 697 ✅ 0 💤 0 ❌
35 511 runs  35 511 ✅ 0 💤 0 ❌

Results for commit bd0ea62.

♻️ This comment has been updated with latest results.

Comment on lines 510 to 373
std::size_t Append(const void *from)
{
if (~fTraits & kTraitMappable)
return AppendImpl(from);

fPrincipalColumn->Append(from);
return fPrincipalColumn->GetElement()->GetPackedSize();
}
std::size_t Append(const void *from);

/// Populate a single value with data from the field. The memory location pointed to by to needs to be of the
/// fitting type. The fast path is conditioned by the field qualifying as simple, i.e. maps as-is
/// to a single column and has no read callback.
void Read(NTupleSize_t globalIndex, void *to)
{
if (fIsSimple)
return (void)fPrincipalColumn->Read(globalIndex, to);

if (fTraits & kTraitMappable)
fPrincipalColumn->Read(globalIndex, to);
else
ReadGlobalImpl(globalIndex, to);
if (R__unlikely(!fReadCallbacks.empty()))
InvokeReadCallbacks(to);
}

void Read(RClusterIndex clusterIndex, void *to)
{
if (fIsSimple)
return (void)fPrincipalColumn->Read(clusterIndex, to);

if (fTraits & kTraitMappable)
fPrincipalColumn->Read(clusterIndex, to);
else
ReadInClusterImpl(clusterIndex, to);
if (R__unlikely(!fReadCallbacks.empty()))
InvokeReadCallbacks(to);
}
void Read(NTupleSize_t globalIndex, void *to);
void Read(RClusterIndex clusterIndex, void *to);
Copy link
Member

Choose a reason for hiding this comment

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

Outlining Append and Read does not allow the compiler to inline them anymore. For simple fields, this inlining allows to directly call into the (principal) RColumn. I'm not sure if this is important, but it's also not clear to me why these functions have to be outlined? They don't seem to use any of the outlined classes / structs...

Copy link
Contributor Author

@silverweed silverweed Sep 24, 2024

Choose a reason for hiding this comment

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

No reason other than "they take up space". If it's important for them to be inlined for performance reasons then I'll just put them back there

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Yes, these two methods should remain inline-able.

@silverweed silverweed merged commit d52b400 into root-project:master Sep 27, 2024
19 checks passed
@silverweed silverweed deleted the ntuple_rfieldbase_outline branch September 27, 2024 07:15
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