Forum Discussion
Eduardo Gomez Romero
Jun 08, 2017Copper Contributor
optimize your code
How would you optimize your code for Mobile
- Lots of information on that here: https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/performance-and-xaml-ui - in general, it is about being really careful with the code that you write, and using the CPU sparingly. Lots of work has been done on asynchronous code development, as probably the biggest CPU burner I've come across recently is wait loops "are you done yet? are you done yet? are you done yet? are you done yet?"
6 Replies
- Eduardo Gomez RomeroCopper Contributorwell as we know microsoft mobile is different from desktop applications so you have to be careful with the battery life and everything else so what implementations would you can see there when you're being an app for mobile device
- Chris JacksonFormer EmployeeLots of information on that here: https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/performance-and-xaml-ui - in general, it is about being really careful with the code that you write, and using the CPU sparingly. Lots of work has been done on asynchronous code development, as probably the biggest CPU burner I've come across recently is wait loops "are you done yet? are you done yet? are you done yet? are you done yet?"
- Eduardo Gomez RomeroCopper ContributorAs a developer I want to know how can i optimize when building for a mobile platform vs a desktop. There are different practices
- Eduardo Gomez RomeroCopper ContributorWhen you build an app, the most important part, that i want to consider is battery life? I would presume that making an app, that requires internet and constantly asking the user if they have internet, would impact the battery life. If so how can Microsoft Word do this and not drain to much
- Chris JacksonFormer EmployeePart of me wants to just post the unhelpful response, which is "write less of it, because less code runs faster". That part won.
But then another part of me decided it would be friendlier to ask what exactly you mean - are you speaking of writing Universal Windows Apps that perform better on Mobile, or web apps that perform well on mobile web browsers as well as desktop browsers, or...? It's a really vague question we're struggling to get you a good answer to... - Samesh SinghCopper ContributorCould you be more specific?