-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fast Thumbnails Loading #7
Comments
Hi Paul, In my experience, the first access to a device is the problem, because here everything is probably loaded into the cache. With further accesses it is much faster. This behavior is due to the internal Windows MTP implementation and has nothing to do with my API. You may be able to get an initial access to your app on startup so it will not be noticed. |
@Bassman2 thanks for hint. I didn't think about it in that way. But how Microsoft achieved it in Windows Explorer? They are generating thumbnails so fast. I saw also some C++/Qt implementations of browsers that have nearly the same loading speed as Microsoft Windows Explorer. And this is great unknown for me. I can just suppose, that the case can be in some wrappers implementations written by Microsoft as COM libraries (probably still in C++), for Qt/C++ there is e.g. mtplib library that is not based on Microsoft shell. And maybe that's the case... Maybe writing .NET wrapper for mtplib is the right way 😄 I will also try to run many processes in parallel that will read from device. One will enumerate files, but another e.g. 5 processes will read images. Maybe that can help to simulate parallel read. I think that parallel reading from separate processes of different MTP objects can be possible 🤔 ... Nevertheless thanks! |
@BrightShadow I'm also using Bassman's great library and I also stumbled about performance issues due to MTP restrictions. As far as I know it's not possible to process multiple accesses in parallel (such as copying to the target and reading). However, if you've managed to find any possible performance improvements I'd appreciate your input very much! |
@anothertal3 I will try :-) Hope to have a solution too, I need it very much in my commercial project. |
I tried to learn some MTP some time ago by using this library to backup pictures from my phone. Apparently, something has changed between 1.5 and > 1.6 as tests started to loose connection to the device during the process (connect, iterate through all folders looking for files to backup, copy those, disconnect). When I find the spare time I will try to get it to work again and if I stumple about any optimization ideas I'll let you know! |
Hello,
I have some speed optimizations built into MediaDevices available on Github.
You can tune it with Item.numObjectsToRequest.
This determines how much FileSystemEntries are requested at once.
Another idea is to use Stream.CopyTo with a larger bufferSize when copying files.
I would appreciate any feedback.
Regards
Ralf
Von: anothertal3 <notifications@github.com>
Gesendet: Freitag, 5. Oktober 2018 09:20
An: Bassman2/MediaDevices <MediaDevices@noreply.github.com>
Cc: Ralf Beckers <ralf.beckers@hotmail.com>; Mention <mention@noreply.github.com>
Betreff: Re: [Bassman2/MediaDevices] Fast Thumbnails Loading (#7)
I tried to learn some MTP some time ago by using this library to backup pictures from my phone.
Apparently, something has changed between 1.5 and > 1.6 as tests started to loose connection to the device during the process (connect, iterate through all folders looking for files to backup, copy those, disconnect).
I hesitate to file a bug as I've yet to determine the culprit (PC, Phone, Library, ...).
When I find the spare time I will try to get it to work again and if I stumple about any optimization ideas I'll let you know!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#7 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AcNLlK7KZul9C_2pMB0oFSKikml6HLz6ks5uhwgngaJpZM4VtnAH>.
|
Hello,
I have some speed optimizations built into MediaDevices available on Github.
You can tune it with Item.numObjectsToRequest.
This determines how much FileSystemEntries are requested at once.
Another idea is to use Stream.CopyTo with a larger bufferSize when copying files.
I would appreciate any feedback.
Regards
Ralf
Von: BrightShadow <notifications@github.com>
Gesendet: Mittwoch, 26. September 2018 19:13
An: Bassman2/MediaDevices <MediaDevices@noreply.github.com>
Cc: Ralf Beckers <ralf.beckers@hotmail.com>; Mention <mention@noreply.github.com>
Betreff: Re: [Bassman2/MediaDevices] Fast Thumbnails Loading (#7)
@anothertal3<https://github.com/anothertal3> I will try :-) Hope to have a solution too, I need it very much in my commercial project.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#7 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AcNLlEzW9JsdnAQrf2DtdYgCkUfGRqSJks5ue7WYgaJpZM4VtnAH>.
|
thanks a ton for your hard work! I don't have a dedicated test but I did a quick experiment using my phone (approx. 10.5 GB content, ~3.000 files):
Note: the device connection was left open during this process. Results (all in release configuration):
Apparently there's indeed some improvement visible :) Regards, |
Alright, did some more testing. I was able to further reduce the amount of time needed by around 50s using your recommended parameters.
Leaving Increasing Regards, |
Hi there!
Before I ask, the effort spent on that library is incredible, I respect it a lot.
I'm creating a photo explorer for MTP devices. The explorer must show image thumbnails as fast as possible. Currently I'm facing the biggest problem with performance. I'm trying to load images in explorer as fast as possible, but min time to get usable files tream is 70ms - 140ms. You can imagine that when loading e.g. 25 images it takes about 2.5s. It is a lot, when you have thousands of pictures on mobile phone, and you want to browse images. My target would be Windows Explorer loading performance. I cannot get, how they did it?
I wonder if this delay is because of .NET wrapper? C++ solutions are much faster, e.g. I saw pictures browser written in Qt where thumbnail were loaded as fast as in win. explorer.
I was checking you code, I see some small improvements, to skip some wrapping code of getting children objects without wrapping them up in Item etc. But I doubt it will help...
Did you have maybe similar situation, or have you some ideas how to load thumbnails of images AFAP?
Any help is welcome!
PS: You can close this issue if it breaks you issue statistics... It is not a bug or problem. Just another use case.
All best,
Paul
The text was updated successfully, but these errors were encountered: