3 ms·
On Android one can switch to C++/NDK for real performance-sensitive components. Other than that most Java use is either in tracking data structures, performing
by nwatson 17y ago
On Android one can switch to C++/NDK for real performance-sensitive components. Other than that most Java use is either in tracking data structures, performing simple operations on them, or else in managing/responding to systems services and events (drawing UIs, responsing to keypresses, reading/writing datastores, etc). In all the latter cases there are so many layers to what happens between initiation and final result that the userland Java code represents a small portion of the total processing time. There would be NO advantage in using C there.
I can buy that game programming will push the limits because many games handle large userland models and need to display much onscreen, but for MOST APPS the biggest problems that lead to perceived sluggishness don't come from using Java but instead from lazy programming where devs assume optimal response to indeterminate-time actions and don't get the optimal case ... e.g., freezing a UI while calling a web service w/ a 30-second timeout.