Skip to content
April 15, 2021
  • Facebook
  • Twitter
  • YouTube
  • Instagram
Facts Overflow

Facts Overflow

Facts for your curiosity

  • Tech
  • Programming
  • Javascript
  • SE
  • Math
  • AI
  • Film
  • Submit a story
  • Javascript
  • Programming
  • Technology

Bloatware Is Bad. But Hybrid Apps are OK

Shalitha Suranga 4 months ago 4 min read

About a decade ago, we had a golden era with pure native desktop applications. However, hybrid applications became popular over native applications due to the easiness of development, beautiful graphical user interfaces, and impressive cross-platform support. Native applications are undoubtedly great from the technical perspective because of their great resource usage, unlike hybrid applications. We all can use hybrid applications without any visible problem because our powerful hardware solves performance issues coming from common hybrid apps.

A few years ago, I tried to use the desktop application of Slack. Thereafter, I found that it was written using the Electron framework which ships a whole browser and a runtime (Node.js) along with each application. This situation popped out a nice question. Why do I need to install a web browser again even if I already have a web browser installed?


Bloatware is bad

If a particular software abnormally uses a lot of the physical resources of the computer over the usability, the specific software is often identified as bloatware. In fact, every software that consumes a lot of resources is not bloatware. For example, if a video editing software takes more resources during the rendering process, we cannot put it into the bloatware bucket. But how about if a normal program takes a lot of space in physical memory?

Visual Studio Code is taking more than 1.2 gigabytes of physical memory, screenshot by the author

Nowadays, almost all developers tend to make their desktop applications using the Electron framework mostly due to the easiness of the development and fast delivery. Unfortunately, they don’t care about performance and efficient resource usage because their main goal is to make a fancy desktop application. But in reality, those hybrid apps become bloatware because more resources are needed just to drive hybrid applications than the actual resource usage of the particular application. Hybrid applications are fine since modern computers are powerful enough to render web-based interfaces fast to give the same look and feel as native applications. On the other hand, we need a framework to make non-bloat hybrid apps.


We need a better way

The popular operating systems such as Linux, Windows, and macOS has a web browser component along with an API. Linux has WebKitGTK, Windows has MSHTML/WebView2, and macOS has Cocoa/WebKit. Electron-based hybrid apps are packaged with the Chromium browser mostly to avoid browser compatibility issues. However, Chromium is a large project. Therefore, even if you build a small app that uses just kilobytes of memory and the disk, the actual memory/disk usage will be a lot of megabytes because Chromium consumes a considerable amount of resources. Further, each native window has a separate Chromium instance. In other words, If you open 10 windows of Visual Studio Code, there will be 10 Chromium instances. Indeed, it is possible to replace Chromium with the built-in browser component to reduce the size of modern hybrid apps.

Moreover, Nodejs is also a quite large project because it consists of a whole JavaScript engine (V8). Most hybrid apps are not frequently using native system calls, some apps are not using at all. For example, if you build a hybrid text editor app, it will call the operating system functions when there is a need to read or write a file. Also, if you are building a calculator hybrid app, there is no need to call operating system functions ever. It is possible to replace Node.js with a kind of native bridge to handle operating system calls coming from the web browser component. The native bridge may handle things like reading files, writing files, executing processes, etc.


Neutralinojs

I started the Neutralinojs project around 2 years ago with some colleagues at the university. Our initial idea was to bypass the browser sandbox by exposing several native features via a client library. The first version of Neutralinojs gave a cross-platform software development kit for developers to build web applications with native operating system functions. In other words, we could make a note editor web application that will directly save notes into the disk. Thereafter, I found that another developer who had the same idea wrote a header-only C++ library called webview to make a cross-platform web view component that uses the existing web browser component of each operating system. That situation was like the story GNU/Linux operating system. Richard Stallman completed the last missing piece of his conceptual operating system by integrating the Linux kernel built by Linus Torvalds.

Similarly, I integrated webview to the Neutralinojs server and made it a cross-platform desktop app development framework. Now, the Neutralinojs server handles native operating system calls coming from the hybrid applications. On the other hand, a modified version of the webview library runs the web part of the hybrid application. After it reached the developer community we created several toolings for developers such as an extensible CLI and several starter templates (For example, Reactjs template and TypeScript template).

Shalitha Suranga

Senior Software Engineer at 99x | Apache PMC member | Open Source Contributor (Author of Neutralinojs) | Technical Writer

See author's posts

Tags: bloatware cross-platform electron hybrid native neutralinojs

Continue Reading

Previous: How to Host Your Open-Source Web App Without Spending a Single Penny
Next: Android One Phones Are Better Than iPhones and Others

Related Stories

image-3 The Unbelievable Facts about Programming 4 min read
  • Programming
  • Software Engineering

The Unbelievable Facts about Programming

Shalitha Suranga 3 months ago
image-2 Top 10 Impressive Quotes of the Most Influential Programmers 4 min read
  • Programming

Top 10 Impressive Quotes of the Most Influential Programmers

Shalitha Suranga 3 months ago
image-1 Privacy On Social Media – It’s Time to Stop Overthinking 3 min read
  • Technology

Privacy On Social Media – It’s Time to Stop Overthinking

Shalitha Suranga 3 months ago
njs Neutralinojs 2021 – Roadmap 2 min read
  • Javascript
  • Programming

Neutralinojs 2021 – Roadmap

Shalitha Suranga 3 months ago
photo-1601553532254-02a1cb74ed67 Android One Phones Are Better Than iPhones and Others 4 min read
  • Technology

Android One Phones Are Better Than iPhones and Others

Shalitha Suranga 4 months ago
photo-1573164713988-8665fc963095 How to Host Your Open-Source Web App Without Spending a Single Penny 3 min read
  • Programming

How to Host Your Open-Source Web App Without Spending a Single Penny

Shalitha Suranga 4 months ago

Recent Stories

  • The Unbelievable Facts about Programming
  • Top 10 Impressive Quotes of the Most Influential Programmers
  • Privacy On Social Media – It’s Time to Stop Overthinking
  • Neutralinojs 2021 – Roadmap
  • Android One Phones Are Better Than iPhones and Others

Topics

  • Artificial Intelligence
  • Film
  • Javascript
  • Programming
  • Software Engineering
  • Technology

Tags

android angular aws bill gates bloatware brian code reviews collaboration computer science cross-platform dennis ritchie design patterns developer tools electron facebook facts framework github history hybrid iphone ken thompson lambda linus linux minimalist mongodb myths native neutralinojs online open-source outstanding programmer phones pioneers privacy quotes roadmap signal socialmedia steve jobs tim berners-lee tools top programmers whatsapp

Archives

  • January 2021
  • December 2020

Connect with Us

  • Facebook
  • Twitter
  • YouTube
  • Instagram

You may have missed

image-3 The Unbelievable Facts about Programming 4 min read
  • Programming
  • Software Engineering

The Unbelievable Facts about Programming

Shalitha Suranga 3 months ago
image-2 Top 10 Impressive Quotes of the Most Influential Programmers 4 min read
  • Programming

Top 10 Impressive Quotes of the Most Influential Programmers

Shalitha Suranga 3 months ago
image-1 Privacy On Social Media – It’s Time to Stop Overthinking 3 min read
  • Technology

Privacy On Social Media – It’s Time to Stop Overthinking

Shalitha Suranga 3 months ago
njs Neutralinojs 2021 – Roadmap 2 min read
  • Javascript
  • Programming

Neutralinojs 2021 – Roadmap

Shalitha Suranga 3 months ago

About FO

FactsOverflow (also known as FO) is an educational non-commercial blog that publishes stories mostly about computer science and programming. This website contains articles written by volunteers who need to show their findings, experiments, and open-source-related activities to the right community.

Technical writers who write for FO like to write more about internals than simple overviews specially for your curiosity.

Follow @factsoflow
  • Submit a story
  • Privacy policy
  • About FO
  • Facebook
  • Twitter
  • YouTube
  • Instagram
Copyright FactsOverflow © All rights reserved. Powered by CodeZri | Kreeti by AF themes.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.

SAVE & ACCEPT