profiling - microsoftxamarinuniversity.blob.core.windows.net/guestlectures/profiling.pdf · ②...
TRANSCRIPT
v Nina Vyedin§ Product Manager at Xamarin § Working on Profiler (and a few
other things...)§ Xamarin Boston office
Who We Are
v Stephen Shaw§ Developer at Xamarin§ Working on the Profiler§ Xamarin Utah Remote Office
Who We Are
v Introduction to profiling: § What it is, when to use it, how
to do it right
v Tools we use for profiling:§ Native§ Xamarin§ 3rd party
What We’ll Cover
What We Won’t Coverv How to solve your particular
memory or performance problems§ Contact support
v Feedback on Xamarin Profiler§ Email [email protected]§ Forum
http://tinyurl.com/XamProfilerv Bugs?
§ https://bugzilla.xamarin.com
What, Why, When
Intro to Profiling
v Gathering data about your app while it’s running
v Instrument the code to see what’s going on inside
v Get information about resource usage
What is Profiling?
Why do we Profile?v We don’t write perfect codev Our tools aren’t perfect
§ Issues with frameworks§ Issues with bindings
v Fewer resources on mobile§ Memory§ CPU
v Solve problems § During development§ Diagnose a hang or blocker
v Deliver a good experience§ Polish before shipping§ Optimize
When do we Profile?
v Profile simple C# appv Memory Profilingv Performance Profiling
Demo: Profile .NET Code
① What is memory profiling?② What is performance profiling?③ When is the best time to profile an application?
Quiz
Native & Xamarin
Profiling Tools
v Profilers for native apps:§ Apple Instruments, Android
Monitorv Useful for issues [on native side?]v Not useful for issues in managed
code
Native Profiling Tools
v Allocations§ Call tree
v Time Profiler
Demo: Instruments
v Android/Google profiling toolv Useful in a few scenarios:
§ Network usage§ Bitmaps
v Gets information about Java side, but not mono side
Demo: Monitor
v Xamarin Profiler for Mac§ Profile iOS, Android, Mac apps
v Xamarin Profiler for Windows§ Profile Android apps
v Profiles managed (mono) code
http://www.xamarin.com/profiler
Xamarin Profiler
Xamarin Profiler
v File format called Mono Log Profiler Data (mlpd)
v Command line version documented here:
http://www.mono-project.com/docs/debug+profile/profile/profiler/
v Install profilerv Launch from Xamarin Studiov Allocationsv Time Profilerv Call tree & backtracev Snapshot comparev File > Save
Demo: Profile iOS
v Launch form Visual Studiov Take snapshotsv Allocationsv Time Profilerv Call tree & backtracev Snapshot compare
Demo: Profile Android
v Use best practices§ http://tinyurl.com/
XamMemoryBestPracticesv Profiling is detective work - don’t
rely on tools alonev Play with Xamarin Profilerv Get in touch!
Final Thoughts
Thank You!Please complete the class survey in your profile: university.xamarin.com/profile
//
Profiling Basics
Guest Lecture