![](https://i.ytimg.com/vi/TDBTiwjTT0k/maxresdefault.jpg)
Java vs C app performance – Gary explains
AndroidAuthority,Android,Gary Explains,Help with coding,Learn to code,Android code,Android Development,Android Dev,Make Android Apps,Android Apps for Beginners
Get 75% off our official Android Development Course run by Gary Sims himself:
Read article:
Java is the official language of Android, but you can also write apps in C or C++ using the NDK. But which language is faster on Android?
Talk about Android in our forums:
Subscribe to our YouTube channel:
—————————————————-
Stay connected to Android Authority:
-
-
-
-
—
Follow the Team:
Josh Vergara:
Joe Hindy:
Lanh Nguyen:
Jayce Broda:
Gary Sims:
John Velasco:
Nirave Gondhia:
#Java #app #performance #Gary #explains
I like the way you explain. Smooth and clear.
well, obviously c is better for functions like this. as it is a functional languange. not for objects like basic game programming though..
Java is a waste of time.
Every time I’ve tried to like Java, I hate it even more. It is quite literally a hog on resources. It might be fine for little toy apps, but try and do something complex with large datasets and everything will come tumbling down. Id love to like it, I’d love it to be a practical useful language for cross platform development. But it isn’t. Go grab yourself a commodore 64 and type some words. Feel how instant the clicks are with PS/2 connectors. Now go and touch your phone apps, or load up your TV guide. The point I am making is the acceptable delay time between guestures and touch is seems to be increasing and nobody really cares. I’m bias … I am a C developer.
nice
Before anyone draws any conclusions that C is superior, remember that companies and customers value programming speed more than performance. Writing the same application in C and Java tends to be much faster to write in Java. Both have their applications and are amazing languages.
Java’s power is in its virtual machine. The virtual machine is also Java’s biggest weakness.
The Java virtual machine can be run on independent hardware (such as a supercomputer) and can be updated.
Also, a custom hacked virtual machine can do advanced clandestine things, such as intercept and profile application data, memory-access signatures.
Oh, and the Java Virtual machine is written in C.
This won’t really matter anyway as Java was written in C.
The butt-hurt C guys in the comments…haha. Love it.
Every person that dont know how to code, would look at these results and pick C…so why thats not the case with programmers? Lazyness?
slightly? you’re kidding right?
This is just arithmetic, the simplest of simplest to implement computing feature. Try adding tests where you have to allocate and deallocate gigabytes of data (like any app with a dynamic GUI would). Also try doing something with strings, or move to a Java vs C++ comparison, and bench some OO paradigms (like just about any app would). Java will be at least 100x slower.
you should compare c++ cus that is more close to the cpu
I am watching a low information “expert.” The very first thing he talks about is only superficially accurate, and at best misleading. He talks about the JVM, and misinforms the viewer on the topic, insinuating the java byte code is interpreted at runtime when it isn’t, it is compiled at runtime. Leading with misinformation is an interesting choice, leading to the conclusion that this “expert” here isnt one and doesnt even know that he is being misinformative. This quack is regurgitating information produced by someone else, and he didnt even bother to question the veracity of any of it. He didnt run any “tests” .. certainly not reasonably valid ones.
commento portafortuna
C could probably beat Java even in that case using march
Even .net platform is much faster then java platform
java is trash i hope one day that Grabage collection that it uses, Removes java alltogether.
Nice
What about unreal?
One thing worth to mention about Java programs is the advantage of the bitecode to use features of future architecture through the JVM, while in C/C++, you need to recompile to machine code in order to utilize the same features. So, unless you recompile your C/C++ software, that initial performance gap between Java and C/C++ will disappear or move in favor of Java if you swap CPU. That’s actually a great feature many applications, like servers that need to swap hardware but still need to provide services 24/7 or even at home if you built your new PC and you just swapped the OS drive. So, if anything, with Java you can be sure that every time you run your program, the software will use all the features of your CPU to the fullest extent.
c: #include <stdbool.h> 😉 std type headers make life a bit easier (if you can use ‑std=c99)
First impression, Java byte code are not zeors and one.
May be this the reason still C is better. C is doing their work for him host one time in life. But Java doing Everytime. They called this is platform independent, let’s enjoy it who cares about nano second when built a big webapp. But these sha things scary in Java webapp
We are in 2020 and we still compare C to some other garbage languages in term of performance!! I mean really!! This doesn’t need comparaison even lol
Ok… I am not convinced at all
Maybe interesting to compare this again(4 years later, using GraalVM on a desktop). What I think should have been compared also, is actual runtime. So no compiler delay included. Cheers
I heard some modern ARM processors can run Java bytecode natively… I wonder how much that changes the performance.
ofc C faster and maybe harder to write
If C is slower than JAVA in just multiplying or adding integers, you have to doubt your programming skill in C.
why don’t you revisit this test today?
Fake stats. Does not account for the JVM init time, which C/C++ programs do not have.
I would also like to see a test significantly involving recursion
the comparison with the Android platform is not correct! you need to check the source code of the function you are using because the Math class in Android is written entirely in c ++. java used in android is not standard java
C program completes its work before the Java app has even started. Plus, Java is a fat pig in terms of memory consumption.
I call Bullsh*t. I guarantee the C code is faster on all platforms. And only being 300% faster seems to narrow of a gap. C is surely even much faster than that. Why not show the code you were using? I am guessing you have nothing to hide, right..? Because C code can slow way down if you are accessing it from JNI, etc.
What a BS channel.
I’d like to point out that while Java is (one of) the fastest non systems programming languages out there, C is the fastest of every systems language, Java can fight it a little but ultimately it’s hopelessly outclassed in every way when both are pushed to their limits
When Java turns out to be faster than C doing math you’ll have to realize something is broken. You can’t amulate faster than machine code.
Lester cosplay
My view is both have benefits and everyone should get along. I prefer Java because I find it more orderly and 99% of applications I design don’t need the performance benefits that come with C.
Sir plz make same video with latest android version
I’d love to see an updated video on this topic! Maybe even using Rust?