Skip to content

Commit ebc6315

Browse files
albfsgsilverweed
authored andcommitted
[ntuple] Move column index to the front of name string
This is an attempt to make Speedscope render columns in similar colors, so they are visually distinguishable from fields. Speedscope does not allow explicit control over frame colors, but it appears to generate them based on the first characters of each string. This behavior was discovered through trial and error, is not officially supported and may still be improvable.
1 parent a79168b commit ebc6315

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tree/ntupleutil/src/RNTupleInspector.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,8 @@ void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile(ESchemaProfileForm
670670
std::size_t columnSize = columnInfo.GetCompressedSize();
671671

672672
SpeedscopeFrame columnSpeedscopeFrame;
673-
columnSpeedscopeFrame.fPrimaryString = tupleDescriptor.GetQualifiedFieldName(fieldDescriptor.GetId()) +
674-
" [col#" + std::to_string(columnDescriptor.GetPhysicalId()) + "]";
673+
columnSpeedscopeFrame.fPrimaryString = "[col#" + std::to_string(columnDescriptor.GetPhysicalId()) + "]" +
674+
tupleDescriptor.GetQualifiedFieldName(fieldDescriptor.GetId());
675675
columnSpeedscopeFrame.fSecondaryString =
676676
ROOT::Internal::RColumnElementBase::GetColumnTypeName(columnDescriptor.GetType());
677677
columnSpeedscopeFrame.fOpeningPosition = positionCursor;

tree/ntupleutil/test/ntuple_inspector.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ TEST(RNTupleInspector, SchemaProfile)
887887
"shared":{
888888
"frames":[
889889
{ "name":"float1", "file":"Type: float, Size: 40B" },
890-
{ "name":"float1 [col#0]", "file":"Type: SplitReal32, Size: 40B" },
890+
{ "name":"[col#0]float1", "file":"Type: SplitReal32, Size: 40B" },
891891
{ "name":"int", "file":"Type: std::int32_t, Size: 40B" },
892-
{ "name":"int [col#1]", "file":"Type: SplitInt32, Size: 40B" }
892+
{ "name":"[col#1]int", "file":"Type: SplitInt32, Size: 40B" }
893893
]
894894
},
895895
"profiles":[

0 commit comments

Comments
 (0)