This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
Process all asset path components at once #5
Labels
performance
More efficient use of time and space
Currently, when resolving a request path of the form
/dandisets/123456/draft/foo/bar/baz
, wsgidav traverses the virtual file tree one level at a time. In particular, this means that, after the/dandisets/123456/draft
is resolved to the given Dandiset & version, wsgidav then requests the member namedfoo
, the member of that namedbar
, and the member of that namedbaz
, resulting in three requests to…/asset/paths/
with differentpath_prefix
es, yet the same effect could be accomplished with just one request to…/asset/paths/
using the finalpath_prefix
. Simplifying the path processing in this way can be done by rewritingDandiProvider.get_resource_inst()
.Problem: Technically, each level of the asset path needs to be retrieved separately in order to check whether the path up to that point refers to a Zarr. However, we can get the above performance improvement while still handling all "well-behaved" Zarrs by just checking whether each path component ends in a Zarr extension (
.zarr
or.ngff
) and, if it doesn't, assuming that the path up to that point does not refer to a Zarr. As this can technically result in inaccuracies for pathological Dandisets, the use of this strategy should be opted-into via a command-line option.The text was updated successfully, but these errors were encountered: