Open benjamin-t-santos opened 11 hours ago
Thank you for raising this enhancement request. The community has 90 days to vote on it. If the enhancement receives at least 10 upvotes, it is added to our development backlog. If it receives fewer votes, the issue is closed.
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: https://github.com/zowe/zowe-explorer-vscode/pull/3279. I hope the team will consider this change and I am open to feedback.