-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reduce the number of API calls performed by DatasetFSProvider.readFile() #3278
Comments
Thank you for raising this enhancement request. |
Thank you for creating a bug report. |
changing label as this is a bug for extenders resulting in a regression from v2 to v3 |
I'm not sure how this would be considered a v2 -> v3 regression as this functionality was not available in v2, and this type of filesystem exposure was only introduced with v3. That said I do agree that it could be interpreted as a bug from the initial implementation (especially if it means that we can get it out with the 3.0.3 release). |
Is your feature request related to a problem? Please describe.
Extenders can use
vscode.workspace.fs.readFile(dsUri)
to fetch a dataset's contents. It will also create an entry for the dataset/member in theFileSystemProvider
if it does not already exist.Currently,
readFile()
makes two MVS API calls. The first call is inremoteLookupForResource()
(it callsfetchDataset()
which callsallMembers()
ordataSet()
depending on the provided URI). The second call is infetchDatasetAtUri()
(callsgetContents()
). I believe we only need to make one API call withgetContents()
.Describe the solution you'd like
Rework
fetchDatasetAtUri()
to only make one API call by doing the following:getContents()
getContents()
fails, the requested resource does not exist on remote and we returnnull
.That is a rough approach we could take. I have prototyped this in my own fork and there is a performance improvement, which is quite relevant when reading the contents of 100s or 1000s of members. I tested reading 600 members in parallel and with this optimization, it is twice as fast.
Describe alternatives you've considered
Using the
DatasetFSProvider
, I do not see a way to get the contents of a dataset that does not already have an entry without making two API calls.Additional context
Here is a PR prototyping that I described above: #3279. I hope the team will consider this change and I am open to feedback.
The text was updated successfully, but these errors were encountered: