Performance issues with local images
Hi - I'm still getting some relatively bad perf issues when loading local images. I think I opened a similar bug a couple months ago but then it was harder to repro.
I recorded a small clip, please look at the images at the bottom of the video. They are all local PNG files and are requested at the exact same time. This uses ff2.1.5
https://www.youtube.com/watch?v=dUVuMpnH2kE&feature=youtu.be
I notice this in my app too.
On Thu, Jun 16, 2016 at 2:32 PM, patook [email protected] wrote:
Hi - I'm still getting some relatively bad perf issues when loading local images. I think I opened a similar bug a couple months ago but then it was harder to repro.
I recorded a small clip, please look at the images at the bottom of the video. They are all local PNG files and are requested at the exact same time. This uses ff2.1.5
https://www.youtube.com/watch?v=dUVuMpnH2kE&feature=youtu.be
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/luberda-molinet/FFImageLoading/issues/252, or mute the thread https://github.com/notifications/unsubscribe/ABvZNEQN9hRb2dSNMFnBMsv8LFjqdfbuks5qMbL3gaJpZM4I3yAd .
Did you have some image network requests while having local ones? Also which device was it?
@molinch this is an iPhone 6
In the video above, there are only local images being displayed.
However, I have other pages which load remote and local images, and the local images seem to take the longest, even when I set them HighestPriority.
@patook @highplains Could you do this:
- Create custom logger as here:
public class CustomLogger : FFImageLoading.Helpers.IMiniLogger
{
public void Debug(string message)
{
Console.WriteLine(message);
}
public void Error(string errorMessage)
{
Console.WriteLine(errorMessage);
}
public void Error(string errorMessage, Exception ex)
{
Error(errorMessage + System.Environment.NewLine + ex.ToString());
}
}
- Use custom FFImageLoading config as here:
var config = new FFImageLoading.Config.Configuration()
{
VerboseLogging = true,
VerbosePerformanceLogging = true,
Logger = new CustomLogger(),
};
ImageService.Instance.Initialize(config);
- Run Release build and send us logs which are produced.
Please post your image loading request. Or you loading via file path or as a compiled/bundled resource?
It is pretty simple:
matchesicon.Source = "coffee.png"; discussionsicon.Source = "discussions.png"; etc.
And "coffee.png", "discussions.png", etc. are BundleResources
@daniel-luberda OK I will try to do this today.
https://www.dropbox.com/s/uma74z46pzqkbca/localimages.mov?dl=0
Feels like the network requests are blocking the local image requests. Profile images I have cached already allow the top toolbar to load instant. But if the image has to be downloaded (example in video) seems to block.
@highplains Do you priorize local requests? By default they both have same priority and we limit number of concurrent requests.
So if you are limited to a max of 2 concurrent requests, and have 2 running web requests, and request some local stuff, then local request will have to wait until web part is done.
I recommend defining a higher priority on local requests.
The local toolbar images are set to "Highest" while everything else on that screen is at "Default"
Ok thanks I will check.
What's also a little weird is that in the video you can see the first toolbar icon always loads even when a network call is made. But anyways, thanks!
echoing what @highplains said, we also have all the local/resources things set to Highest
CachedImage matchesicon = new CachedImage { Source = "coffee.png", LoadingPriority = FFImageLoading.Work.LoadingPriority.Highest }; CachedImage discussionsicon = new CachedImage { Source = "discussions.png", LoadingPriority = FFImageLoading.Work.LoadingPriority.Highest }; CachedImage connicon = new CachedImage { Source = "connections.png", LoadingPriority = FFImageLoading.Work.LoadingPriority.Highest }; CachedImage visitorsicon = new CachedImage { Source = "visitorsicon.png", LoadingPriority = FFImageLoading.Work.LoadingPriority.Highest }; CachedImage usericon = new CachedImage { Source = "usericon.png", LoadingPriority = FFImageLoading.Work.LoadingPriority.Highest };
@patook Is it possible to see performance logs? Thanks
@daniel-luberda yes, sorry, I'm just in the middle of a big change and need to check in before I can play with this.
Here you go, I had to run it in debug but the same error persists. Is this enough data?
Generating/retrieving image: coffeeselected.png
Generating/retrieving image: Discussions.png
Generating/retrieving image: connections.png
Generating/retrieving image: visitorsicon.png
Generating/retrieving image: usericon.png
Thread started:
Just so you know, replacing CachedImage with Image (the normal XF image) shows me the image immediately.
@patook Thank you for logs, indeed there's something wrong here:
[PERFORMANCE] RunAsync - NetManagedThreadId: 14, NativeThreadId: 17, Execution: 989 ms, ThreadPool: False, Key: Discussions.png
I'll need to do some tests. Is to possible you could send me those images?
here they are in order: coffeeselected.png connections.png Discussions.png usericon.png visitorsicon.png
I'm not sure if github re-formats PNG files so if there's no repro, give me an e-mail address and I'll send them to you.
Sure, I'll delete those images here. Email is on my profile page: https://github.com/daniel-luberda
@daniel-luberda OK e-mailed