-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid GetChildren when using Specific servable versions
For some filesystem providers, like GCS, GetChildren does a lot more work that a simple FileExists call. This change special cases the `SPECIFIC` ServableVersionPolicy and does direct FileExists calls for each one. In the common case of a single version, this can be a single stat() call and avoid an expensive directory listing entirely. This optimization *only* applies when the versions and directories are equivalent to "base_dir/%d". So this fast path now happens before the GetChildren call, but will fall back to the general case of a directory listing when there are folders like: base_dir/ - 00001/ - 2/ and you want the specific version 1. Generally speaking, the support for strtod-ifying the string name is nice, but forces the directory listing. PiperOrigin-RevId: 627111947
- Loading branch information
1 parent
0fe7da7
commit 6fb9403
Showing
3 changed files
with
146 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters