Readit News logoReadit News
zerocount commented on Why Is C Faster Than Java (2009)   marc.info/?l=git&m=124111... · Posted by u/signa11
echelon · 4 years ago
The article title is "Why is C Faster than Java".

I would expect to see Java, C#, C, C++, and Rust mentioned quite a bit in the threads here. It's all relevant.

zerocount · 4 years ago
Based on the article, the title should be, "Why is C Git faster than JGit." It's literally nothing but that.
zerocount commented on Why Is C Faster Than Java (2009)   marc.info/?l=git&m=124111... · Posted by u/signa11
jillesvangurp · 4 years ago
The counter argument here is something like Lucene, which is written in Java but has been heavily optimized over the years using many of the same kinds of tricks the Git people used to optimize Git. There are frequent attempts to replicate parts of what Lucene does in different languages; usually under the assumption that it will be faster and better because of magical properties people associate with things like native compilation or the supposed manual memory management skills of the programmers doing the work.

Most of these efforts are relatively niche compared to Lucene because they never quite catch up in terms of features, scale, etc. and because the programmers involved are messing around on the fringes of the problem space instead of coming up with algorithmic breakthroughs, which at this point is the quickest way to make things faster. Well, that and cutting some major corners and pretending it's all the same by running some silly benchmark.

The fallacy here is confusing language, idioms, memory models, frameworks, etc. and assuming it's all set in stone. It isn't. Just because you are using Java does not mean everything has to be garbage collected, for example. Lucene actually uses memory mapped files, byte buffers, etc. for a lot of things. So, it does not actually need to do a lot of garbage collecting. It uses the same kinds of solutions you'd pick when using C. And they perform ballpark as you'd expect them too meaning that unless you improve the algorithms, you are not going to be magically a lot faster. The same is true of hotspot, the JVM's runtime compiler, which is written in C and, surprise, uses a lot of the same kind of trickery used by the fine people working on e.g. LLVM. So, a lot of things people assume must surely be slower just aren't and a lot of the insurmountable bottlenecks that people assume must surely be there always actually have well known ways of being worked around.

Of course there is always room for more optimization. Lucene is well over two decades old now and they still regularly come up with major performance improvements. There's nothing magical about how they do that; just a lot of hard work that goes into it that would be somewhat challenging to improve on just by switching language and compilers.

zerocount · 4 years ago
There's no counter argument to an article that specifically breaks down why C git is faster that JGit back in 2009. Lucene isn't relevant.
zerocount commented on Why Is C Faster Than Java (2009)   marc.info/?l=git&m=124111... · Posted by u/signa11
bsder · 4 years ago
Well, I would prefer that people would discuss alternate systems programming languages when "C is fast" comes up.

We could use some perspective from, say, Ada programmers. Unfortunately, none of them ever seem to show up.

zerocount · 4 years ago
They don't show up because their not out evangelizing every oppurtunity they get.
zerocount commented on Why Is C Faster Than Java (2009)   marc.info/?l=git&m=124111... · Posted by u/signa11
Ygg2 · 4 years ago
It's actually the opposite. If anything being evangelical about Rust is heavily discouraged

The truth is Rust is an amazing language, with its own warts (async, Pin, etc.), but there is pent up demand for language that fits its description. Non-manual, non-GC low level oriented language. It's not a wonder some projects are switching to Rust

zerocount · 4 years ago
What exactly is switching to Rust?
zerocount commented on Lua: Good, Bad, and Ugly Parts (2012)   notebook.kulchenko.com/pr... · Posted by u/Svetlitski
cies · 4 years ago
If you need a few line here an there scripting, sure Lua, JS, PHP... whatever works.

Using these languages for large projects is where the trouble starts: as they push you towards bad solutions that we know are bad for many decades. You need clear description of how to avoid these pittfals, or your growing codebase slowly becomes unmanageable.

I ended up ditching a growing Lua codebase for this reason. Get out before it gets to big to get out.

zerocount · 4 years ago
I'm not convinced scripting languages are not suitable for large projects. It's said a lot, but I've never seen proof one way or the other. I suspect unmanageable code-bases derive from uncontrollable project forces, ignorance, or not caring, but not because of the perceived short comings of a scripting language.
zerocount commented on The Sound of Silence: A Noise Map of the U.S.   nps.gov/subjects/sound/so... · Posted by u/hairytrog
twiddling · 4 years ago
"Loud pipes save lives"

ugh

zerocount · 4 years ago
I roll my window up if I'm near motorcycles. There's been too many times when my ear got blasted all of a sudden.

Worse is booming bass. Not while driving, but at home from the neighbors. Hours on end... boom... boom...

zerocount commented on Ask HN: What are the best tech books you read in 2021?    · Posted by u/hintymad
slmjkdbtl · 4 years ago
Crafting Interpreters by Robert Nystrom
zerocount · 4 years ago
Can't wait for this. I'm still on his 'patterns' book. He's such a good author.
zerocount commented on JavaScript for Impatient Programmers   exploringjs.com/impatient... · Posted by u/arkj
nope96 · 4 years ago
"7.1.1.3 Assertions .... It is part of a Node.js assertion API that is explained later in this book."
zerocount · 4 years ago
This is what happens when you're impatient.
zerocount commented on JavaScript for Impatient Programmers   exploringjs.com/impatient... · Posted by u/arkj
Lamad123 · 4 years ago
Start with Javascrip, the Good Parts.
zerocount · 4 years ago
For beginners, this is the last book to start with. I'm a big fan of Doug Crockford, but this book is opinionated and the examples are often not well explained.
zerocount commented on Running IntelliJ Idea with JDK 17 for Better Render Performance with Metal   mustafaakin.dev/posts/202... · Posted by u/CSDude
flatiron · 4 years ago
For Java there really is no replacement for IntelliJ. I don’t think people “talk shit”. I use vscode and I enjoy it. I don’t use it for Java.
zerocount · 4 years ago
I'm not a Java developer so forgive my ignorance, but is Eclipse as good as IntelliJ?

u/zerocount

KarmaCake day235August 7, 2021View Original