Gadgetory


All Cool Mind-blowing Gadgets You Love in One Place

Actually, Android IS optimized - Gary explains

2017-01-20
hello - Gary Sims from Andrew authority and one of the comments I read quite often attached to my YouTube videos particularly videos that touch on Android performance or on iOS in some way is that Android isn't optimized now why do people write that why do people make those comments online YouTube videos and is there any truth to it well let me explain so why do people make these comments that Android isn't optimized well I think that there are two reasons I think the first reason is that somewhere deep in people's minds whenever they read something that talks about how a different phone other than an Android phone could actually be doing a good job they kind of have a you know kind of a mental crisis and they have to come up with an answer to why that particular phone could be better than the phone they have and somewhere deep down in the psychology people say oh it's because andrew is not optimized maybe they're thinking that if it war doctor my you think the next version of Android that comes out or or something's going to happen magically it's going to make my phone better than the other phone I think also there's an element to it of the kind of whole idea that applicant portraying for years even before the iPhone came out and that is that it just works this idea of a tightly integrated system which of course we found first of all in the Mac Apple controlled the software the hardware the ecosystem and that kind of model they carried on forward into the iPhone whereas of course Android comes from a whole variety of different manufacturers you've got Sony and Samsung and HTC and LG and Huawei and loads of others and they all use processes from media taken Qualcomm and Huawei and Samsung and they displays from different places and their different version of Android and people talk about Android fragmentation and it kind of gives this idea away or kind of things like chaos and and and not a coherence at all and that leastly idea is not optimized whereas Apple is just optimized one phone for one manufacturer with one Hardware one software and it's all meant to be tightly knit together well is that true let's have a look so the first thing we have to look at is the different programming languages that I use for iOS and for Android because wherever your accusations that are often thrown at Android is a user's Java and Java has to use a virtual machine because it uses an intermediate language called the Java bytecode which is interpreted at runtime on the phone whereas iOS uses native apps you you use an objective-c or Swift compiler and it produces direct machine code which runs on the phone there for Android is slow in unoptimized whereas iOS is sleek and fast well that's really actually not true and there are a number of reasons for that first of all on a normal app for example if I am using the Gmail app the app spends most of its time actually just waiting for me to press something it's not kind of doing intensive computing tasks it's not kind of you know calculating all these immensely difficult things you know he's waiting me to tap something and then when I tap something actually then wait for the network to respond so if I'm using a 3G connection or a 4G connection or or you know I thought wait two days to come over the network and then come back to my phone before it can display something so apps actually spend most of their time waiting for user input or waiting for the network and the majority of productivity apps don't do much in the terms of calculations I mean there's not much calculational CPU power going into displaying email for example and it's also worth mentioning that there is a native development kit available for Android where you can write programs in C and C++ and if you play any kind of game based on unity or based on the Unreal Engine and there's probably several others as well they're actually just native apps not running in Java they're running C that's being compiled down to machine code because you couldn't do all that 3d stuff in Java you really have to do it for the best performance in C so at the end of the day when they use benchmarks or running I actually contacted Geekbench about this I asked the people at geek bench when you run a benchmark are we trying to compare Java on Android and Objective C on an Apple phone missus know both of them actually written in C and they both compile using the respective tool chains you get the same code running on both Android and running on on iOS it's not a debate about Java versus C or native versus Java that's just naturally not true another thing that's interesting is that actually Android has developed its virtual machine significantly over the years and androids being developments before 2008 if you compare Android 2.0 X to androids 7 that we have to doe mean there's a huge difference between them and the code has been modified and changed and being made better for example we've seen these new changes with the art virtual machine actually there's so much compiling that goes on beforehand so actually the Java rack are turned into native apps but it does that actually in the phone when you install the app and if you look at my Java versus C performance video that I've done on this channel you will see that while C is faster it Java isn't so terribly slow that actually is just it's just laughable but actually the difference between Java and C is actually not as far apart as we might think now there's also the other interesting thing is actually large parts of Android itself are written in C and not in Java for example the Linux kernel which is part of Android is completely written in C and there are other part of the android framework now the part in android subsystems are all written in c so it's not as if we're waiting for Java for absolutely everything that goes on there's lots of C in native machine code that running when an Android app run then there's a question of does Apple add some hardware optimizations that aren't available for example in Android things that can happen in hardware and therefore happen quicker but Android isn't able to do now there's probably some truth to this how they get to the bottom of it is a little difficult let me explain Apple have what's called architectural license from arm which means they're allowed to design their own CPUs they've got their own engineers and they don't actually ask arm for anything they just say we're going to sign an arm compatible CPU now that compatibility is verified by a set of tests they have to run provided by arm but when they run them they get the results that says this is an arm compatible CPU core but the question that's kind of floating around and I've been I've asked people this in kind of tech conferences and so on is does Apple add extra instructions to the CPU because the test as far as I know can't test for extra instructions they can only test a standard arm program will realm up a new CPU without failing and then it adheres to the specifications of the instruction set now let me give an example in arm v7 there was no cryptographic instructions for doing a AES of cryptography and when arm invented arm v8 they added in these instruction so now when you do a s cryptography on an arm 64-bit ARM processor it actually loads times faster like seven or eight times faster than it would be on a 32-bit arm v7 architecture because there are these extra instructions that are very useful for doing as a cryptography kind of operations so maybe Apple have analyzed their own operations and maybe they've analyzed their own SDK to say hey if we had an instruction that did this that could give us a five percent increase to it another instruction that did this that could give us another five cents into it and they may have added that to their silicon now that is possible now the problem is the compilers that are Apple use are open-source and when we look at the compilers we don't see immediately anyway we don't see that there are extra instructions that are being being produced by this compiler now could it be that Apple have their own in-house compilers for compiling our iOS itself that also possibly true so we have anecdotal evidence that Apple could be doing this but actually nothing nothing concrete now a second way that Apple could be actually boosting things in hardware is to create a six type of execution engine that's very good at doing a certain thing now we actually only have those in all fo seas from Apple and from Qualcomm and Samsung and whoever because the GPU and DSPs and image processors are exactly that they are bits of discrete Hardware on the chip that are good at doing certain things hey you want a something encoded in a particular video codec well ask the video encoder do it and that's done in hardware so Apple could be adding in something else that says hey we know that we do a lot of this kind of stuff in our in our operating system so if we had a piece of hardware that did it then it would be really good you just load up the kind of the data and you say to that bit of hardware go and execute and process that now that could be very well true and that could be buried into the SDK so that when an app developer writes an app the SDK automatically calls that execution unit to do that kind of thing but here's the interesting thing you see because Qualcomm and others can do exactly the same thing if you look at a Qualcomm Snapdragon CPU it's full of different components including the DSP an isp and and the GPU and the SDKs that they provide allow you to call those functions of fat Qualcomm have what's called the hexagon DSP SDK which allows apps writers to compile apps and optimize them for core core processors and the DSP could not does more than just digital signal processing which is what it original was used for now you can even do image processing it can do recognition it can do some kind of VR and AR and it's really complicated kind of dedicated piece of hardware that does specialist functions so if Apple are doing that we can also be sure that people like Holcomb and Samsung are also doing that as well so what about system integration every piece of hardware needs a piece of software so Apple designed the processor for their phone but they also have to design these software and because they are working for the same company and there's a great level of coherence between these two teams obviously they're working very closely to make sure all the software and hardware work together very well and that can't be true in Android well because there's all these different OEMs all we did SOC makers and all this well actually it's not quite like that for example arm when they license some of their intellectual property like this is a court it's a 73 core to someone like Iowa or the cortex a53 core to someone like mediatek they have to provide them with the software that goes with it because there's a whole bunch of stuff that's needed also for the GPU and for the CPUs there's a whole bunch of softer now now those companies crew write all that software themselves but there's very little point arm our specialist at working with their own hardware so they sell hardware and software to these SOC makers so that when the SOC makers then produces a chip actually it has the right driver than the right software and of course it's in arms absolute benefit that those drivers are optimized absolutely essential then it gets the best performance through that software so there are loads of software engineers at arm who work on just making the Android software and likewise if you're coming like Qualcomm of course who design their own core sometimes who've got their own GPU they have their own people just like Apple do and just like arm to who write their own software to make sure the drivers the integration with Android is at its most efficient otherwise it's pointless than spending millions and millions of dollars developing the latest Snapdragon processor and then they've got no software for it and in fact they're losing 30 percent their performance through some by software that doesn't happen they've got equal investment in the software and in the hardware and what about Android itself maybe people think the Android operating them is somehow just kind of this woolly blob but it doesn't really have any optimization well again that's not true because first of all a open source which means that of course lots of people have looked at the code i've looked at the code lots of people have made changes to it lots of people work on the linux kernel and the loads of different stuff that are going or arm themselves contribute loads of code to the nearest kernel specifically for ARM processors and specifically for mobile then of course you've got Qualcomm and you've got Samsung and you've got all these other companies Sony HTC and LG they all have to build Android themselves for their phones and it doesn't take too much of a brilliant engineer to do a quick test to say hey this is running slowly on our piece of hardware let's find out why oh look there's not to Malaysian we can do here that's not really rocket science for engineers who do this thing absolutely every day so there's been loads of engineering eyes who have actually been studying the code and looking at it to find out whether there are any optimizations that can be done now that's kind of code level optimization but what our system level you know how the whole thing is put together from the kernel and the drivers and the frameworks and the java virtual machine and the apps on top about how is that all optimized well think about who write it we're talking about Google here now Google are brilliant at doing system integration I mean Gmail YouTube Google search I mean none of these things could work properly with all the millions of requests per second all the videos being streamed constantly that just will all fall apart if Google were no good at doing system integration but they are good at doing sin to me integration that's why they've got thousands and thousands of servers and huge server rooms and just terabytes and terabytes of of hearted and it's all optimized at the system level to develop and to deliver the most efficient a video and email and open search results because otherwise their business which is go bankrupt so therefore of course Google engineers have that knowledge and the idea that the Android team can't do that kind of thing as well it just is just plainly absurd so where does that leave us well basically it means that Android is optimized it's optimized at a system level because Google know how to put together a system it optimizes the code level because so many different engineers looked at the code it's optimized by every OAM you see Samsung are going to spend loads of money on developing the latest handset and then find it crippled by some bad software that's not going to happen they got software engineers working on that but why do we still have this question that Apple products are more integrated but again it goes back to what I think I said at the beginning there is this kind of story put out by Appl that it just works that the integrated approach is the best approach where they control the hardware the software and the ecosystem but really of course it actually comes down to this there's only about one iPhone per year where there are hundreds of Android phones and that dedication that focus on bringing out just one phone kind of lead people to believe that they've Apple have put all their efforts into doing this one thing and they're not distracted by doing other things whereas Android seems to be chaotic seem to be so many hands that so many different things and surely that must be better than that well actually it is not true because companies like Samsung the companies like LG and other comes out just wouldn't be able to survive if they didn't have an optimized solution for Android well my name is Gary Sims from AI under Authority I hope you enjoyed this video I really look forward to hearing your comment below just one thing if you are going to comment and place things like you have Android is an optimized give me some proof show me something that tells you that Android isn't optimized show me the code point to me to an area where you can say I know this is not my kind really like to know if it's just a woolly ideas you've got what I hope this video has corrected your your woolly thinking please don't forget to subscribe to Angela for --'tis youtube channel also please do download the Android or 'ti app because that will give you access to all of our news and stories directly on your mobile phone and last but not least please go over to Andrew authority comm because we are your source for things Android you
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.