News for hackers. Stuff that matters.
Re:Jetbrains founders turn billionaires without VC help by drKarl on Friday December 18, 2020 @09:45AM (#25467548)
That is actually a misconception. You may have this mental classification of Java as a slow language if you looked at its performance 20 years ago. Now it's actually really fast, it goes neck to neck with C++. Sure, Rust or Go or C (or definitely assembler) might be faster in some workloads, but Java is definitely very very fast nowadays. It uses a lot of memory because of the way Garbage Collection works, but it is fast. It's definitely faster than Python, Ruby, PHP and many other kids on the block...
Re:Jetbrains founders turn billionaires without VC help by apocalyptic0n3 on Friday December 18, 2020 @10:07AM (#25467761)
> It's definitely faster than Python, Ruby, PHP and many other kids on the block...

I don't know why, but I got a good laugh from that statement. Those "kids" are all the same age or older than Java; PHP, Ruby, and Java were introduced within a few months of each other in 95 and Python dates back to 91.

Re:Jetbrains founders turn billionaires without VC help by drKarl on Friday December 18, 2020 @11:08AM (#25468400)
I know, I didn't say "kids" implying these languages were new, it was just a manner of speaking.
Re:Jetbrains founders turn billionaires without VC help by apocalyptic0n3 on Friday December 18, 2020 @11:38AM (#25468758)
Yeah, I assumed as much. I doubt anyone is calling those languages "kids" at this point, even with PHP's reputation. I just found it funny to word it like that.
Re:Jetbrains founders turn billionaires without VC help by xamolxix on Friday December 18, 2020 @10:03AM (#25467726)
> it goes neck to neck with C++. Sure, Rust or Go or C

I hate to be that guy but 1) java does not go neck to neck with c++ unless you mean it can be in the same order of magnitude and 2) C++ is not slower than C or Go or Rust

Note: by c++ I mean c++ compiled by a decent compiler e.g. gcc/clang/msvc

Re:Jetbrains founders turn billionaires without VC help by sweeneyrod on Friday December 18, 2020 @01:17PM (#25470090)
Yes, out of Rust, C, C++ and Go, the slow one is going to be the one with a GC.
Re:Jetbrains founders turn billionaires without VC help by tomjen3 on Friday December 18, 2020 @03:24PM (#25471455)
Java is fast enough for most things, but try working with an array of a million objects in C++ vs Java and you will see the difference.

In Java you will have to deal with an array with a million pointers to a million objects and in C++ you will deal with a sequential segment of memory that is a million times the size of your object - and mostly in your CPUs cache. That alone will be much, much faster.

But you can't do that in Java at all.

Re:Jetbrains founders turn billionaires without VC help by nlitened on Saturday December 19, 2020 @04:07AM (#25476230)
I think in this case you’re holding the tool wrong.

When you want, for example, an array of (float x, float y) “objects” in Java, you just keep them as two arrays (float[] x, float[] y) — and I guarantee it will use the same amount of memory and will have nearly the same speed as C++ (depends on what cache locality you need for a specific task, it might even be faster to have two separate arrays for some tasks).

So yeah, depending on the language, a slightly different implementation is more efficient, so one has to know its tools.

Also, as far as I know, when project Valhalla extension goes live, you will have an option to do packed structs the same way as C++ or C# does.

Edit: Oops, there was another reply about the same in the thread. I should remember to refresh the threads before answering in the morning.

Re:Jetbrains founders turn billionaires without VC help by tomjen3 on Saturday December 19, 2020 @08:47AM (#25477365)
That would be a workaround, but it annoys me when you have to make a workaround for something that is available in the language it set out to replace.

And if you are doing something like nearest cluster mapping, or anything else where you process your data in linear order you are not going to get the optimized cache locality. Plus you can't read the file with mmap if your data is from there.

Re:Jetbrains founders turn billionaires without VC help by nlitened on Saturday December 19, 2020 @01:08PM (#25479559)
I agree that Java is not the best tool for things like analyzing mmap'ed data. Java replaces C++ by being better in some things, not all.

I would go further and say that if your job is analyzing terabytes of memory-mapped binary files, maybe C++ is not optimal either, and investing in specialized languages like Shakti/K would pay off quickly.

Re:Jetbrains founders turn billionaires without VC help by hucker on Friday December 18, 2020 @03:48PM (#25471770)
You typically wouldn't use an array with a million objects in Java if you cared about performance though (for exactly that reason), you'd architect it some other way. Using SoA style when appropriate, for example.
Re:Jetbrains founders turn billionaires without VC help by iamcreasy on Friday December 18, 2020 @11:52PM (#25475155)
Do you mean Structure of Arrays? Can you point to some resource to learn more about Java SoA? Quick google search didn't yield anything useful.
Re:Jetbrains founders turn billionaires without VC help by devmor on Friday December 18, 2020 @12:04PM (#25469130)
>It's definitely faster than Python, Ruby, PHP and many other kids on the block...

I would seriously contest the speed of Java compared to modern PHP. The JIT puts PHP at near-C performance levels with competently written code. Which shouldn't be surprising if you realize PHP is largely a "wrapper" around C.

Re:Jetbrains founders turn billionaires without VC help by victor106 on Friday December 18, 2020 @12:42PM (#25469691)
https://www.techempower.com/benchmarks/#section=data-r19&hw=...

Vertx framework which is based on Java is at 8th position and PHP is 18th.

But the larger point is performance is only one aspect while considering which programming lang. or framework to use

Re:Jetbrains founders turn billionaires without VC help by RobAley on Friday December 18, 2020 @01:40PM (#25470355)
I think you've proved your second point by getting your first wrong. The benchmarks posted are for a stack including PHP, not PHP itself (and not the fastest stack with e.g. pgsql). Also, I don't think thosd benchmarks use php 8, which is the first version with the jit that the post above referred to.
Re:Jetbrains founders turn billionaires without VC help by victor106 on Friday December 18, 2020 @02:20PM (#25470810)
https://www.google.com/amp/s/onilab.com/blog/php-7-vs-php-8/...

From the page above The bottomline: PHP 8 is still slower than PHP 7.

This is a realistic comparison of running Magento on php7 vs php8.

Re:Jetbrains founders turn billionaires without VC help by ta988 on Friday December 18, 2020 @11:24PM (#25475013)
You may not know that Java has a JIT and a AOT if you want even a bit more perf for cold start. And they are really good.
Re:Jetbrains founders turn billionaires without VC help by jcelerier on Friday December 18, 2020 @03:28PM (#25471518)
> Now it's actually really fast, it goes neck to neck with C++.

yet every time I try a Jetbrains IDE every action seems to take 10x the time to be processed than it takes in QtCreator

Re:Jetbrains founders turn billionaires without VC help by drKarl on Friday December 18, 2020 @06:44PM (#25473504)
Once it's finished indexing things it feels darn instant to me. What hardware do you use? Also which programming language? I've used IntelliJ with Java, Scala, Kotlin, Groovy, Markdown, and many file types and it's really snappy.
Re:Jetbrains founders turn billionaires without VC help by jcelerier on Saturday December 19, 2020 @01:57AM (#25475678)
I have an i7 6900k and 64 GB of ram. Indexing on the project I work on takes something like 3 hours. But I'm not even talking about that - just the basic user interaction, opening a menu, switching tabs... It's notslow but it drags its feet a bit.