@@ -140,16 +140,6 @@ private bool InternalLinkExists(string path, H5LinkAccess linkAccess)
140140 var segments = isRooted ? path . Split ( '/' ) . Skip ( 1 ) . ToArray ( ) : path . Split ( '/' ) ;
141141 var current = isRooted ? Context . File . Reference : Reference ;
142142
143- // The first hop of a RELATIVE path is this group, whose object header is already decoded and
144- // held. Dereferencing our own reference to get it - which is what this did - builds a second
145- // NativeGroup and decodes that header again, from the file, on every lookup.
146- //
147- // The cost is proportional to the number of LINKS, not to the depth of the path, because a
148- // group that stores its links compactly keeps one header message per link: measured on a
149- // 1000-link group written by PureHDF's own writer, one LinkExists re-read 30,113 bytes and
150- // allocated 2.1 MB, and 2000 links doubled both. A lookup that missed cost exactly as much as
151- // one that hit, since the whole cost was the re-decode rather than the search.
152- //
153143 // Only the first iteration can reuse a group we already hold; every later segment names an
154144 // object not yet resolved, so this is cleared at the end of each pass.
155145 var group = isRooted ? null : this ;
@@ -183,7 +173,8 @@ internal NativeNamedReference InternalGet(string path, H5LinkAccess linkAccess)
183173 var segments = isRooted ? path . Split ( '/' ) . Skip ( 1 ) . ToArray ( ) : path . Split ( '/' ) ;
184174 var current = isRooted ? Context . File . Reference : Reference ;
185175
186- // See InternalLinkExists for why the first hop of a relative path reuses this group.
176+ // Only the first iteration can reuse a group we already hold; every later segment names an
177+ // object not yet resolved, so this is cleared at the end of each pass.
187178 var group = isRooted ? null : this ;
188179
189180 for ( int i = 0 ; i < segments . Length ; i ++ )
0 commit comments