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] Fixes lookup & searching in the descriptor #17004

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jblomer
Copy link
Contributor

@jblomer jblomer commented Nov 21, 2024

Fixes several instances of lookups in the descriptor from linear to logarithmic complexity. As a result, many of the limit tests results improve significantly. So much so that I think we can turn on most of them on a regular basis.

Relies on #16986

/// May contain only a subset of all the available clusters, e.g. the clusters of the current file
/// from a chain of files
std::unordered_map<DescriptorId_t, RClusterDescriptor> fClusterDescriptors;
std::vector<RExtraTypeInfoDescriptor> fExtraTypeInfoDescriptors;
std::unique_ptr<RHeaderExtension> fHeaderExtension;

// We don't expose this publicy because when we add sharded clusters, this interface does not make sense anymore
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: publicy
Also, it should probably be a TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this is a TODO. We never plan to make this a public interface. Because with sharded clusters, this interface would be confusing (multiple possible clusters for the same entry number).

Copy link

github-actions bot commented Nov 21, 2024

Test Results

    18 files      18 suites   3d 22h 41m 49s ⏱️
 2 680 tests  2 679 ✅ 0 💤 1 ❌
46 404 runs  46 398 ✅ 0 💤 6 ❌

For more details on these failures, see this check.

Results for commit 2c5a443.

♻️ This comment has been updated with latest results.

Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

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

For the limits test, we should also check the memory consumption in addition to the time...

Comment on lines +384 to +396
const auto &clusterIds = GetClusterGroupDescriptor(fSortedClusterGroupIds[cgMidpoint]).GetClusterIds();
R__ASSERT(!clusterIds.empty());
Copy link
Member

Choose a reason for hiding this comment

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

unrelated (for now): this requires deserializing all page lists to populate all cluster group descriptors. In the future, we may first want to search loaded cluster groups under the assumption that by loading the (global) entry first, we already have the necessary information...

Comment on lines +487 to +499
const auto firstEntryInNextCluster = clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries();
return FindClusterId(firstEntryInNextCluster);
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth shortcutting the common case here and check if clusterId + 1 contains firstEntryInNextCluster?

return kInvalidDescriptorId;
if (clusterDesc.GetFirstEntryIndex() == 0)
return kInvalidDescriptorId;
return FindClusterId(clusterDesc.GetFirstEntryIndex() - 1);
Copy link
Member

Choose a reason for hiding this comment

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

same question here

@hahnjo
Copy link
Member

hahnjo commented Nov 27, 2024

Limits_ManyPagesOneEntry fails in the CI: it fills a std::vector<int> with 100 million elements and writes it as a single page. That probably means memory usage in the order of GBs, we probably should leave it disabled.

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