-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
DirectoryStore .keys()
optimisation.
#562
Comments
Good point! The other thing we might consider is using |
Notes, And yes |
I do have a prototype which appear to be a bit faster on small zarr on my laptop.
Some tests do seem to rely on keys ordering though... |
How much does it cost us to sort ourselves? |
I don't know and we should try on a particularly big dataset. I've restarted and it might have been an actual bug in my implementation as test passed this time... I've send #563 with a rough implementation to see if it fails on windows. We may also want to not be lazy and compute also compute the length while we loop, as currently |
It could also be a bug in Zarr. Really ordering shouldn't matter, but I may be proven wrong ;) Sounds good. Yeah that seems like something that could be more efficient. |
It looks like the
keys()
method of directory store reimplement a lot of the logic ofos.walk()
that could be used to increase efficiency.in particular using
os.walk()
will directly return directory and files separately and will avoid the two extra expensive call toos.path.isfile(path)
, andos.path.isdir(path)
.forming the keys will be a tiny bit less straightforward than current method as
os.walk()
returns the full relative path you gave it whether or not you terminate it by a slash, so we might have to be careful with this.(I also note that this methods does list os specific files, like
.DStore.
. not sure this is on purpose.The text was updated successfully, but these errors were encountered: