Comparing Performance and Energy Consumption of Android Applications:Native Versus Web Approaches

Comparing Performance and Energy Consumption of Android Applications:Native Versus Web Approaches

Mobile applications are usually developed in a nativeway, using languages and APIs specific for a given platform,hindering the portability. As an alternative, web technologiesas JavaScript and PHP have been employed enabling a sameimplementation to be executed in different mobile platformswithout any recompilation or recoding process. This papercompares the efficiency of Android applications developed inJava (native), in PHP, in JavaScript and using Node.js throughexperiments that evaluate execution time and energy consump-tion. Our experiments explore computation complexity and aswell as communication aspects relevant for the PHP and Node.jsapproaches. Results indicate that native implementation is thebest one, regarding performance and energy consumption untila certain processing load. As this load is significantly increased,the Node.js implementation presents the lowest execution timesand energy consumption.

Tablets, ultramobiles and mobile phones are changing theroutine of people and organizations around the world, repre-senting a very important market of consumer electronics aswell as applications. In [1] Android is pointed out as thedominant mobile Operating Systems (OS), although devicesrunning iOS, or other OSs are also found on the market.Each OS represents an ecosystem that includes specific APIs,frameworks, and development tools, and usually also definesa language to be employed in development [2] [3].To handle the diversity of ecosystems, traditionally, nativeapplications have been developed using the language definedby the target platforms. The native approach was the predomi-nant way to develop mobile application for a time, since it canpresent advantages, as a better usage of platform resources as3D graphics or sensors.On the other hand, modern web technologies directedtowards mobile are rapidly gaining interest from large com-munities of developers [4] [5]. These web-based approachesemploy languages that are not native to the device’s OS [6], asHTML5, JavaScript, and PHP. As advantage, these approachesenable one single implementation to be shared across the targetplatforms and also not having to deal with deployment specificissues related to some of the ecosystems [6] [7], being knownas cross-platform approaches.As mobile devices usually have limited resources anddepend on battery to work, approaches that allow migrateprocessing and data storing for a remote server, saving device’sresources [8], as web or cloud based ones, have receivedattention. Following this approach, mobile applications arevery closed to the traditional web systems adopting also aclient/server architecture. These systems adopt different tech-nologies/languages for the front-end (client side) and back-end (server side). Usually, front-end can be developed inHTLM5 or JavaScript, but the server side usually adopts PHP.However, recently Node.js [9] is proposed as an open-sourcecross-platform JavaScript runtime environment, which enablesdevelopers to write server-side components using also theJavaScript programming language.Differently from the native applications, the web-basedmobile ones are executed from an embedded web browser.This additional layer can generate some overhead and thusimpact negatively on application performance. Moreover, ap-plications developed in PHP and or using Node.js, requirecommunication with the web server. Depending of the volumeof data transfered, this communication can also impact neg-atively in performance and energy consumption. In contrast,locally executed applications (i.e native, and JavaScript ones)tend to consume more with processing compared to the onesimplemented in PHP or using Node.js.Comparative studies among native and cross-platform appli-cations have been published, since this tendency has emerged.However, most of these works consider only criteria as de-velopment facility, usability or end-user experience, and asmall number of works discuss also performance or energyconsumption [5]. Since these metrics are very important inthe context of mobile devices, this work has as objectiveto compare native Android applications developed in Javato web-based applications developed in PHP, JavaScript andNode.js. Through experiments, we evaluate the impact ofadopting these approaches, regarding performance and en-ergy consumption. Besides, we discuss when the adoptionof a client/server solution can provide benefits on efficiencycompared to the local approaches. Yet, this work exploresthe Node.js technology, which has recently emerged as aperformance improvement strategy for web-based applications,evaluating how its usage impact on application efficiency