I'm building a Xamarin app, using ImageSharp for image manipulation.
I've noticed that the ImageSharp operations are very slow in the emulator and ridiculously slow when deployed to a physical device (Galaxy Note 8).
Things that are way slow:
// Load image (very slow)
var image = SixLabors.ImageSharp.Image.Load(stream);
// Manipulate image (equally slow)
image.Mutate(i => i.Resize(new ResizeOptions
{
Mode = ResizeMode.Pad,
Position = AnchorPositionMode.Top,
Size = new SixLabors.Primitives.Size(600,400))
}));
Note that the image loads fine (albeit slowly) and the resizing works, but it's very slow (30-60 seconds).
Executing the same code from a .NET Core console program reduces the load and manipulation times to about 1-2 seconds.
With the debugger attached, I see a flood of these when ImageSharp operations are running:
GC_MINOR: (Nursery full)
I'm not really sure how to troubleshoot this, is my only option to clone the ImageSharp repo and debug using a custom build?
Edit: Not sure if this may be related to this issue?
Edit #2: I gave up on ImageSharp and also tested OpenCV to no particular avail and then settled on SkiaSharp which works great right out of the box.
Related
No matter what I try, I cannot get FFImageLoading disk caching to work in my Xamarin Forms app. I have FadeAnimationEnabled turned on, with a long duration, so that I can easily see when images are cached vs not.
In memory caching is working great, no long fade-in on the second load.
But relaunch the app, and I see the long fade, no caching.
Turn off WiFi, and then no images at all.
I have tried CacheType as both All and Disk
I have CacheDuration set to 30 days
I call both Init() and InitImageSourceHandler() after XF.Init() in AppDelegate (and equivalent on Android)
Images are loaded from remote URL (Google Storage HTTPS)
I use MonkeyCache for other local disk caching with no problems
Configuration:
Both iOS and Android
FFImageLoading 2.4.11
XF 4.7.0
Any input would be much appreciated!
MediaCapture gives poor quality of QR code image captured, because of which QR code decoder(Zxing) is not able to decode the QR code(Windows Phone 8.1 universal app)
The problem comes only if QR code becomes more complex, i.e. generated out of long string(more then 180 characters), for QR codes generated out of small strings(less then 180) it works fine.
If I feed image directly to Zxing decoder(copy qr image to solution and provide uri) it works fine. But if I capture image using mediacapture api await captureManager.CapturePhotoToStorageFileAsync(imgFormat, file);
and feed it to decoder it does not work,
By looking at the image you posted in the comments for the other answer in conjunction to the code snippets you're using for focus, I would guess that you're calling the focus API at the wrong time. Make sure to use the FocusControl (and other "auto" controls such as WhiteBalance and Exposure) after starting the preview.
Also, focus takes some time to converge, so make sure you're waiting for the operation to finish before capturing a photo.
Have a look at the CameraResolution SDK sample on the Microsoft Windows Universal Samples GitHub repo. You should be looking into using the GetAvailableMediaStreamProperties method, pick the resolution you want to use, and set it on the MediaStreamType of your choosing (Video, Photo, Preview) by using the SetMediaStreamPropertiesAsync method.
Do read through the full sample, though. There are some details (like the number of MediaStreamTypes supported by the camera, see VideoDeviceCharacteristic) that you should understand to build a robust camera app.
I am developping a Phonegap application using nice UI tools, like ReactJS, with requestAnimationFrame and things like that.
I am trying to have rendering performances of 60fps.
According to this article:
http://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
To have 60 fps, the browser has to be able to do, under 16ms, the following:
JavaScript
Style calculations
Layout
Paint Setup & Paint
Composite
I can see the performance of each in Chrome DevTools by looking at the frames. My Js code is pretty fast thanks to how React optimises the dom manipulations, and the whole fit under 16ms most of the time.
However, these informations are for my computer, my CPU and GPU...
I'm interested to have these informations for different mobile devices, to see how they will behave and to know what is the minimum device level to have 60 fps.
Are there any tools to inspect browser rendering frames for most popular mobile devices?
Is there an easy way to slow down my computer so that it behaves like a mobile phone in term of performances?
What about the impact of other apps running on the phone that could use some of the phone's resources?
You could hook up a remote web inspector with the phone an profile the rendering performance like you would on your computer. This is supported on on iOS 6+ and on Android 4.4, assuming the app is in debug mode. However, hooking up the remote web inspector distorts the results as it imposes a serious performance bump itself.
If you're just interested in measuring raw fps my suggestion is to inject stats.js, a little widget that displays a fps graph:
https://github.com/mrdoob/stats.js/
I used this to benchmark different game engines and got decent results.
I am developing an app for WP8 in which data is coming from server(Cloud) And want to show huge data in scroll viewer it's working fine only the problem is crashes after some time due to memory problem I have checked in performance tool it exceed memory limit more than 150 MB in scroll viewer I am showing Images which comes from server please give me idea how can I get rid off this problem if someone else face problem.
if you use huge amount of data you can use Incremental loading
check this :
Windows 8 Series – Incremental Loading
I have created a Flash game which plays at 60 frames per second. It plays fine in all browsers except Internet Explorer 8 and 9; in these cases, it seems to be half (or less than half) the intended frame rate.
I have tried embedding it even by using Flash Authoring Tool's own html code, as well as the swfobject method, but to no avail. In all cases, GPU acceleration is enabled.
It's also not a matter of CPU performance, since it is tested on the same computer with all other applications closed. The problem only rises with IE.
One final peculiarity to consider : I have loaded FRAPS to count the actual rendering frame rate and it shows it to be 60 fps (inside IE), although it's crystal clear that this is not the actual speed achieved.
sounds like flash isn't properly installed on your IE browser
Try the following (assuming you have Adobe Flash Player v10.2 installed):
• Restart your computer.
• Open Internet Options (located in the Control Panel).
• Click on the Advanced tab.
• Click on the Reset button, place a check next to Delete Personal Settings and then click Reset.
• Launch IE9 and Adobe Flash Player will be properly enabled.
then try your tests again
GPU acceleration is not always the best solution. It depends on the way you have code the app.
Try another wmode value.