Skip to content
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

FilePicker.PickMultipleAsync very slow #18199

Closed
joshua-lemli opened this issue Oct 20, 2023 · 4 comments
Closed

FilePicker.PickMultipleAsync very slow #18199

joshua-lemli opened this issue Oct 20, 2023 · 4 comments
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/windows 🪟 t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.)
Milestone

Comments

@joshua-lemli
Copy link

joshua-lemli commented Oct 20, 2023

Description

Using the FilePicker.PickMultipleAsync seems to be very slow. I have a process where a user selects multiple files (which will later be parsed). The method to pick the files is much slower than the code that actually reads/parses the files afterward! This shouldn't be the case.

File picker is basically unusable due to the many seconds of latency between when the dialog is closed and the results become available (i.e. when the method returns).

It seems like the file picker actually touches/reads the files after the user closes the dialog? Picking files in a location with high latency (e.g. a network drive) is much slower than picking the same files from local system.

image
Here you can see the time the FilePicker is busy, picking about 250 files (each ~100kb), it takes almost half a minute for the file picker to return the result!

The time between closing the picker dialog and await FilePicker.Default.PickMultipleAsync() completing seems to increase linearly the more files are selected.

Testing with VS 17.7.5 and .NET7 with an empty/boilerplate MAUI Blazor project. Building for release/debug does not appear to impact the issue. Deploying to windows, win-x64, all tests on a windows-11 machine.

Steps to Reproduce

  1. Create a MAUI project (I'm using MAUI Blazor)
  2. Use the default FilePicker and invoke PickMultipleAsync (awaited or not, doesn't matter)
  3. Select more than a few dozen files and accept the selection in the dialog
  4. Method takes an unreasonable amount of time to complete (more than several seconds)

Link to public reproduction project repository

No response

Version with bug

7.0.96

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@joshua-lemli joshua-lemli added the t/bug Something isn't working label Oct 20, 2023
@jsuarezruiz jsuarezruiz added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Oct 20, 2023
@mattleibow mattleibow added the legacy-area-perf Startup / Runtime performance label Oct 24, 2023
@mattleibow mattleibow added this to the Backlog milestone Oct 24, 2023
@ghost
Copy link

ghost commented Oct 24, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@mjsb212
Copy link

mjsb212 commented Mar 20, 2024

joshua-lemli I'm having a similar problem. How many files are you picking? Mine lags after about 200-500 files are chosen. Anyone know a workaround?

@joshua-lemli
Copy link
Author

joshua-lemli commented Mar 21, 2024

joshua-lemli I'm having a similar problem. How many files are you picking? Mine lags after about 200-500 files are chosen. Anyone know a workaround?

@mjsb212 I definitely notice lag picking hundreds of files, often when picking far fewer. In scenarios where the files are slow to be accessed (e.g. a network drive) the issue is compounded -- this seems unnecessary for a tool that just delivers file paths, especially when a user can already view and select those paths.

It's not much of a work-around, but, building a custom file-picker in MAUI (Blazor hybrid) is quite simple, and is the best solution I've found. This is just unfortunate given that the MAUI FilePicker exists and (technically) works. There are also UI toolkits (like Radzen) that offer their own file-pickers, although I do not know how performant they are.

@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
@MartyIX
Copy link
Contributor

MartyIX commented Jul 13, 2024

This seems to be the same issue as #19868 which was fixed.

@MartyIX MartyIX closed this as completed Jul 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/windows 🪟 t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.)
Projects
None yet
Development

No branches or pull requests

6 participants