Re:How Four Native Developers Wrote an Electron App
by flukus on Friday May 19, 2017 @01:56AM
(#14373317)
In an artificial benchmark they are pretty similar, but in real world idiomatic code they are very different to c++. Nearly everything is on the heap so you've got pointers everywhere, dynamic data structures are used everywhere, virtual functions (particularly with java) and interfaces. There's is a reason java was so much slower than native code 20 years ago and that gap has been bridged by CPU progress more then compiler progress.
[ Parent
| on HN ]
Re:How Four Native Developers Wrote an Electron App
by pjmlp on Friday May 19, 2017 @02:26AM
(#14373401)
You are forgetting the crappy programmers as well.
I lost count how many times I have reviewed code where a for loop is used instead of System.arrayCopy().
Or the times I have seen code that my CS data structures teacher would probably give a plain 0, even if done in C.
Re:How Four Native Developers Wrote an Electron App
by flukus on Friday May 19, 2017 @04:20AM
(#14373756)
It's probably for the best those people aren't writing c/c++ ;)
I'd love to make them code in rust, their inability to write code, to even copy/paste it will save so many maintenance problems.
Re:How Four Native Developers Wrote an Electron App
by forgotpw1123 on Friday May 19, 2017 @07:46PM
(#14380161)
This just isn't true. There's many Java ports of C/C++ applications and benchmarks are usually within 30%.
Re:How Four Native Developers Wrote an Electron App
by coldtea on Sunday May 21, 2017 @10:20AM
(#14387425)
For the easy tasks. Try a CPU heavy C/C++ app -- like an audio/video editor, number crunching of any kind, etc.
Re:How Four Native Developers Wrote an Electron App
by forgotpw1123 on Tuesday May 23, 2017 @08:21PM
(#14406623)
Like I said, the major exception is SIMD instructions. AV and heavy math are a tiny fraction of applications. For these you can use JNI.
There is precedent for this in Netty where they use a native poll mode driver and everything else Java, and it performs about as fast as pure C code on Techempower benchmarks