DEV Community

Discussion on: Pitch me on Java

Collapse
 
saptakbhoumik profile image
SaptakBhoumik

I don't think it's performance is bad compared to other interpreted languages. Sure it is slower than compiled languages but very fast for most task. Also what do you mean by no backup facility?

Collapse
 
ivan_jrmc profile image
Ivan Jeremic

I never coded in Java but used many internal developed Java softwares and every single one was slooow. We had the same app later rebuilt with Electron which was fully written in JavaScript/Node and it felt like 50 times faster.

Thread Thread
 
siy profile image
Sergiy Yevtushenko

Slow apps could be written in any language. Java is not an exception.

Thread Thread
 
leob profile image
leob

Those "internally developed Java softwares" were likely desktop apps ... let's be frank, Java on the desktop (applets, JWT, Swing and all that) sucks ... do not, I repeat do not, use Java on the desktop - should only be used server side!

Thread Thread
 
abhinav1217 profile image
Abhinav Kulshreshtha

@ivanjeremic

We had the same app later rebuilt with Electron which was fully written in JavaScript/Node and it felt like 50 times faster.

If you think electron was faster, you can't imagine the performance of tauri, or webview.

I have worked on Java desktop app. They can be really fast if you compile it for production, which uses compiler optimization flags. Yes startup time can be slow in some cases, but JVM has been improving a lot in past few years. Memory footprint of J9 is also in league of its own.
It also depends on framework used, In my experience, If animations are avoided, Fx is really fast, compared to swing. That said, Swing is really performant library. Eclipes IDE uses SWT which is built upon on swing.

Thread Thread
 
leob profile image
leob

Good to hear a bit of a different view, the huge amount of bashing that Java gets (often not based on actual knowledge) can be tiresome ...

Collapse
 
siy profile image
Sergiy Yevtushenko

Java is Just-In-Time compiled language. It's performance comparable or even better to compiled languages like C or Rust.

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic • Edited

I know that JavaScript is a JIT language it is comparable but not faster it can however have a few areas where it is as fast as compiled or faster, but most of the time just comparable.

Thread Thread
 
siy profile image
Sergiy Yevtushenko

JS as a language has some specific (variable type may change at run time, for example), which makes efficient JIT compilation somewhat tricky.

Collapse
 
leob profile image
leob

Sorry but it's not an "interpreted language", not by a stretch ... it uses a JIT compiler, once a piece of code (class or method) has been JIT-compiled it essentially runs almost at C/C++ speed (well, with still some runtime overhead in the form of garbage collection and all that).

Thread Thread
 
saptakbhoumik profile image
SaptakBhoumik

I know that. I am just comparing it's speed with an interpreted language

Thread Thread
 
leob profile image
leob

Right, well then you know it's not in the same league :)

Collapse
 
stealthmusic profile image
Jan Wedel

I can only second that. Performance is actually very good, in fact it outperforms natively compiled C++ code in many situations as the hotspot VM aggressively optimizes at runtime.
Also I don’t understand what „backup facility“ means.

Collapse
 
bigbott profile image
bigbott

Kindergarten here.
When Java became interpreted?
Go to school, take some lessons.

Thread Thread
 
saptakbhoumik profile image
SaptakBhoumik • Edited

Before arguing properly READ WHAT I SAID. I am just comparing it's speed to an interpreted language.

Thread Thread
 
bigbott profile image
bigbott • Edited

You don't have problem with Java alone, but with English and languages in general.

Sentence: "I don't think it's performance is bad compared to other interpreted languages." states that you think that Java is interpreted language.

Thread Thread
 
saptakbhoumik profile image
SaptakBhoumik • Edited

Listen comparing java's speed with an interpreted language doesn't mean that I think it is an interpreted language. That like saying fighter jet is sound because we often compare it's speed with sound(mach number literally means number of times faster than sound). So instead of arguing(in this case you are completely wrong) do something useful or maybe learn english and how to behave online

Thread Thread
 
bigbott profile image
bigbott • Edited

Ok. Let me give you kindergarten level example.

I think that Ferrari is fast compared to OTHER bicycles.
Word OTHER here means that Ferrari is a bicycle. Otherwise, it completely redundant.
I hope you finally learned something.

Also, you don't actually need to think about Java performance. Just check some benchmarks. For example: github.com/kostya/benchmarks. You will see that Java between fastest and for some tasks Java is the fastest language. And its main competitors are C, C++, Rust and Go. Are those interpreted in your opinion?
You will also see, that comparing Java to interpreted languages like Ruby, Python and PHP is meaningless as its performance usually ten times higher.

Opinion that Java is slow comes exclusively from "new language of the day" propagandons and aimed into idiots who tends to believe everything they read more than once.