Skip to content

AODNative: read the directory records and key lists of the next DFs ahead - #16176

Open
ktf wants to merge 4 commits into
AliceO2Group:devfrom
ktf:pr16176
Open

ktf wants to merge 4 commits into
AliceO2Group:devfrom
ktf:pr16176

Conversation

@ktf

@ktf ktf commented Nov 23, 2026

Copy link
Copy Markdown
Member

Listing a DF took two dependent reads, its directory record and then its
key list, each a round trip on a remote file. Read those of the next 16
DFs, in read order, with them: one vector read for the records and one
for the key lists, at most 1 MiB of key lists. Metadata only; the cache
is replaced at each read-ahead.

ktf added 4 commits November 23, 2026 11:23
Opening a file took 7 sequential reads: the header, the top directory
record, the key list, the metaData map, the first DF's directory record,
its key list and its TTrees. ROOT's TFile::Init takes 3. Each is a round
trip on a remote file.

- The first read takes 4 KiB instead of 128 bytes: it then also holds the
  top directory record and, as ROOT writes them first, the first DF's.
- metaData is read when asked for: the reader never asks (metadata
  discovery opens the file with ROOT).

Now 4 reads for an AO2D with metaData, 5 for a derived one with
parentFiles.
…ader

TJAlienFile::GetElapsed(), the open_time of the ROOT reader, covers the
open of the replica which is read and TFile::Init. The native reader's
also covered the catalogue lookup, replicas which failed to open, retry
delays, parentFiles and the first DF's directory, keys and trees, so the
two could not be compared.

open_time now covers the open of the replica read and its header and
keys. The rest goes in new fields of the same lines, before se= so that
open_time stays last: access_time (catalogue), failover_time (failed
opens, retry delays and reopens, for the life of the file) and
prepare_time (parentFiles and the first DF).
…in the native reader

The trees to prefetch were set when the plan of a new DF was made, but
the DF's keys are listed earlier, when DPL asks for the tree handle. So
the second DF of a file still fetched every TTree, as the first. Set the
list as trees join the plan instead.
…head

Listing a DF took two dependent reads, its directory record and then its
key list, each a round trip on a remote file. Read those of the next 16
DFs, in read order, with them: one vector read for the records and one
for the key lists, at most 1 MiB of key lists. Metadata only; the cache
is replaced at each read-ahead.
@ktf
ktf requested a review from a team as a code owner November 23, 2026 12:27

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant