Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ②...
Transcript of Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ②...
![Page 2: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/2.jpg)
v Nina Vyedin§ Product Manager at Xamarin § Working on Profiler (and a few
other things...)§ Xamarin Boston office
Who We Are
![Page 3: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/3.jpg)
v Stephen Shaw§ Developer at Xamarin§ Working on the Profiler§ Xamarin Utah Remote Office
Who We Are
![Page 4: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/4.jpg)
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
![Page 5: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/5.jpg)
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
![Page 6: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/6.jpg)
What, Why, When
Intro to Profiling
![Page 7: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/7.jpg)
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?
![Page 8: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/8.jpg)
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
![Page 9: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/9.jpg)
v Solve problems § During development§ Diagnose a hang or blocker
v Deliver a good experience§ Polish before shipping§ Optimize
When do we Profile?
![Page 10: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/10.jpg)
v Profile simple C# appv Memory Profilingv Performance Profiling
Demo: Profile .NET Code
![Page 11: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/11.jpg)
① What is memory profiling?② What is performance profiling?③ When is the best time to profile an application?
Quiz
![Page 12: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/12.jpg)
Native & Xamarin
Profiling Tools
![Page 13: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/13.jpg)
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
![Page 14: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/14.jpg)
v Allocations§ Call tree
v Time Profiler
Demo: Instruments
![Page 15: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/15.jpg)
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
![Page 16: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/16.jpg)
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
![Page 17: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/17.jpg)
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/
![Page 18: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/18.jpg)
v Install profilerv Launch from Xamarin Studiov Allocationsv Time Profilerv Call tree & backtracev Snapshot comparev File > Save
Demo: Profile iOS
![Page 19: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/19.jpg)
v Launch form Visual Studiov Take snapshotsv Allocationsv Time Profilerv Call tree & backtracev Snapshot compare
Demo: Profile Android
![Page 20: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/20.jpg)
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
![Page 21: Profiling - Microsoftxamarinuniversity.blob.core.windows.net/guestlectures/Profiling.pdf · ② What is performance profiling? ③ When is the best time to profile an application?](https://reader034.fdocuments.us/reader034/viewer/2022042303/5ece2e4fee11c142a623df89/html5/thumbnails/21.jpg)
Thank You!Please complete the class survey in your profile: university.xamarin.com/profile
//
Profiling Basics
Guest Lecture