Live data from Hacker News

Why is C faster than Java: git vs JGit

marc.info

11–20 of 106 posts

Re: Why is C faster than Java: git vs JGit

#12

> when you do use Java NIO MappedByteBuffer, we still have to copy to a temporary byte[] in order to do any real processing Does anyone know why this is the case?

mmap uses the virtual memory manager to map a file into virtual memory as it does for swapping.

The memory you have is therefore allocated by the kernel of your operating system and oblivious to any garbage collector you might have.

Re: Why is C faster than Java: git vs JGit

#14
post #7

I find it kind of interesting that in Haskell, which is arguably even higher level than Java, most of these optimisations are eminently possible.. EDIT: This obviously came across a bit as language fanboyism, so I guess I should mention that the language features that let you do many of them let you shoot yourself in the foot just as easily as you can in C, and you can certainly argue that with a strong FFI you might…

[deleted]

Re: Why is C faster than Java: git vs JGit

#17

Note the date: 2009-04-30 18:43:19 Many of us have already read this and it's been submitted to HN several times before. This, of course, does not mean that it's not worth reposting, but interested parties may want to dig up some of the past discussions.

Here's one: http://news.ycombinator.com/item?id=1026909

Re: Why is C faster than Java: git vs JGit

#18
In cases where performance actually matters, just avoid bit-twiddle in high-level languages. It sucks too much. You'll probably waste less time on optimizations by offloading the biggest bottlenecks to C/C++ with the native/extension interfaces in your high-level language of choice.

Be careful and stay standards-compliant and you can keep most of the portability and maintenance advantages while picking up some significant speed.

Re: Why is C faster than Java: git vs JGit

#19

I almost skipped this link; I assumed it was typical borring blog noise. It's not. This is an insightful post from the git mailing list which shows some of the real limitations that a top tier developer hits when trying to write Java code as fast as neatly optimized C code. Definitely worth reading.

Same here. Nothing groundbreaing about Java vs C threw.

Edit: I mean most of the problems (maybe features) of java are known.

Post reply on HN