5 ms·
I love what Mozilla is trying to accomplish with Firefox OS. I hope it succeeds, and I don't want to be negative. But I'm not convinced about this part: > Fire
by mwcampbell 13y ago
I love what Mozilla is trying to accomplish with Firefox OS. I hope it succeeds, and I don't want to be negative. But I'm not convinced about this part:
> Firefox OS offers the best cost-benefit ratio once you think about how much performance you have against your hardware specs. If you pick the same low-end hardware with Android or Firefox OS, Android will have a worse experience, not because Android is broken in any way, Android is great but because there are more things going on on Android than on Firefox OS. Firefox OS is just a tiny hal, gecko and gaia, while Android has a VM and lots of other things going on.
Let's look at some of the components that a modern mobile OS needs:
* Kernel
* Hardware abstraction layer
* OpenGL ES implementation and compositor
* 2D vector graphics API
* UI toolkit
Android and Firefox OS both also have a VM to run managed code, along with a JIT compiler. Android's VM, Dalvik, was specifically designed to be memory efficient in the case where several apps are running as separate Unix processes. Is the same true of SpiderMonkey?
So Android and Firefox OS share many of the same types of fundamental components, and in some cases, the same components (the kernel, some aspects of the HAL). But on top of this, Firefox OS and its apps add:
* Markup language processor and layout engine designed for hypertext documents, not UIs
* Parser for a poorly designed programming language (JS), and advanced JIT optimizations that in effect extract the latent static types from a dynamically typed language. By contrast, Dalvik accepts bytecode as input, and the program is already statically typed, so the JIT compiler can be much simpler
* Hacks on top to turn this combination of hypertext markup language and poorly designed programming language into a tolerable UI toolkit and application platform
So how can you say that Firefox OS is more resource-efficient than Android? Perhaps the Android platform developers have gotten sloppy lately, since they're primarily concerned about high-end phones. But that can be remedied. What matters is that, as far as I can tell, the Android platform was designed for efficiency, while the Web platform was not.
I hesitate to bash the Web platform, because for better or worse, it seems to be the best way of achieving Mozilla's mission, and I believe social ends outweigh technical means. But I believe I have accurately described the current reality.
- pjmlp 13y agoPlus all other mobile OS allow for the use of pure native code if you really need to go full performance, not so with FirefoxOS.
- soapdog 13y agomwcampbell, Thanks for your reply. =D In the high-end market, it doesn't matter, everyone is good. In the low-end market, Firefox OS has better performance than Android. From a high level analysis, your comment appears spot on but unfortunately it is not that simple. Dalvik VM is GREAt and we all know the bad parts of JS. The problem is that there is a lot going on on android phones. Its not as if there is only Dalvik and your app. In Firefox OS Gecko is so close to the hardware that it doesn't need to go thru hops. Firefox OS can be said to be nothing but a browser running on bare metal. Android is not slow, but on low-end hardware it is not as responsive as it should be. Pick a Galaxy Ace for example, its specs are similar to ZTE Open (ZTE Open has better specs) and the price is similar but the experience is much better and more responsive on ZTE Open. Dalvik was created to be efficient, and it is. My comment is not about Dalvik being bad, it is not. Its about low end phones running android offering a bad experience. I don't know if you ever used those phones or if you ever tried a Firefox OS phone. > Hacks on top to turn this combination of hypertext markup language and poorly designed programming language into a tolerable UI toolkit and application platform HTML evolved. The current standards and practices are pretty good. Check out new JS proposals, the language is evolving and becoming better. While you may perceive the combination of HTML/CSS/JS as something horrible, others like it. Check out enyojs at http://enyojs.com http://enyojs.com for example, it is a great framework for app development that shows the potential for pure web based solutions. As you said: > What matters is that, as far as I can tell, the Android platform was designed for efficiency, while the Web platform was not. And yet, the web runs pretty well inside a browser in Android right? Even with all Android around it, open web apps running in a browser (when built correctly) do pretty great. Now remove Android and just leave the browser. Imagine how much complexity went away. How much CPU cycles and memory you saved if you have nothing but a web runtime. We all agree that Android is a great platform. As I said, this is not an attack on Android. Firefox OS is a return to simplicity where you have just a web based architecture that is being optimized and refactored into a great mobile platform. We're not picking Desktop Firefox and shoehorning it into a mobile device. Firefox OS is being built for mobile. You certainly know your tech and so I will leave you with an invitation. Android development is not open, Google releases new versions of Android when it wants to and then you see the source code. Even so, Android is hard to hack. On the other hand, Firefox OS is developed in the open. All source code, including whats is being worked on is live on github. Better than me sprouting opinions and experiences here is for knowledgeable people such as you to check the code out. See how it is being built and how things work together. Help shape a better platform for everyone. Everyone is encouraged to contribute to Firefox OS. If you think SpiderMonkey (or IonMonkey or OdinMonkey) is slow, help improve it, we could all use some help! :D https://github.com/mozilla-b2g/ https://github.com/mozilla-b2g/ As I said, one of the key thinks about Firefox OS is how open it is. Want to try to develop new features? Check out the repo, hack away and if it good enough, talk about a pull request on IRC. If you want to check out the system without building it, pick the Firefox OS Simulator, it is just a add-on for Firefox at https://addons.mozilla.org/firefox/addon/firefox-os-simulator/ https://addons.mozilla.org/firefox/addon/firefox-os-simulato... For example, you will notice that we use the Android kernel and parts of Android SDK tools such as adb and fastboot. The cool think about open source is that you can reuse the good bits and not use what you don't want to. So I invite you to check out the platform. The web may appear badly designed and not build for performance but there are more and more people working on it and it just grows and surprises us. No one believed in JS for gaming until people saw the unreal engine running inside the browser without plugins. JS and its friends will keep improving and cross-plaform open solutions tend to win in the long run.
- Ygg2 13y agoYour points aren't really strong either. > * Markup language processor and layout engine designed for hypertext documents, not UIs Unlike XML which Andorid uses, right? I mean XML was made for designing arbitrary (potentially hyper-linked or linked) documents, no? > * Parser for a poorly designed programming language and advanced JIT optimizations. So are you talking Java or Javascript?! At this point it doesn't matter. Without doing any benchmarks and solid number crunching your claim is empty air. This doesn't mean Firefox OS is more resource efficient than Android. Without benchmarks on same hardware neither can claim performance high ground.
- Yoric 13y ago> Android and Firefox OS both also have a VM to run managed code, along with a JIT compiler. Android's VM, Dalvik, was specifically designed to be memory efficient in the case where several apps are running as separate Unix processes. Is the same true of SpiderMonkey? Short answer: yes, SpiderMonkey has been designed to be quite memory efficient. > But on top of this, Firefox OS and its apps add: Actually, let me clarify something, if not for you, then for our readers: "on top of this" means essentially "on top of the kernel and HAL," rather than "on top of Android." > [valid points] So how can you say that Firefox OS is more resource-efficient than Android? Perhaps the Android platform developers have gotten sloppy lately, since they're primarily concerned about high-end phones. But that can be remedied. All your technical points are valid. However, you have not taken into account the fact that Android is much larger than that not to mention, conceptually, very old. Just the Core Libraries, for instance, offer at least three or four ways of reading/writing files. Most of these APIs should be removed for the sake of performance, as they were based on Java 1.0 designs from the 1990s, a time at which industry believed that disk speed would keep improving as fast as CPU speed and that concurrency was too expensive to be used. But these APIs cannot be removed, simply because too much code depends upon them, both in Android itself and in applications that Google would not want to lose. Sadly, this means that all such code is a performance hog, especially on mobile devices, since mobile storage is horribly slow in comparison to PC storage. Now, while I am less familiar with the rest of the architecture of Android, I seem to remember this is true of many features and that many features are accidentally implemented several times in the kernel, Dalvik, the libraries and/or the frameworks, in the interest of (partial) compatibility with Posix, Linux, J2SE, etc – and tutorials. While it would theoretically be possible to get rid of all these inter-layer duplications, and to only keep the good APIs, this effectively means breaking too much of both Android itself and of many applications. Google cannot afford to do that, as they would risk driving away all developers and users. Moreover, Google does not need to do that, as Android has always been targeted towards high-end phones. A new operating system, by opposition, with everything to win and nothing to lose, can start from a blank state. Moreover, since Firefox OS offers only high-level APIs and no NDK-style access, it is easier and will remain easier for a number of years, to perform whichever low-level refactorings are necessary to improve performance and/or memory efficiency without breaking applications. Note that this is almost the reverse of Chrome vs. Firefox. Firefox is burdened by the number of add-ons that need to be supported, and the low-level APIs provided to these add-ons, while Chrome, starting with a blank slate and restricted public APIs, managed to rise the stakes of performance quite harshly.