Earlier quoted context omitted.
See: http://www.sqlite.org/different.html Money quote about half-way down the page: "SQL statements compile into virtual machine code" Every SQL database engine compiles each SQL statement into some kind of internal data structure which is then used to carry out the work of the statement. But in most SQL engines that internal data structure is a complex web of interlinked structures and objects. In SQLite, the compil…
Off-topic but relevant: I've been looking for info on just how database software does what it does. Ie from parsing the SQL query to hitting the disk, and everything in between. Anyone got any links or books?
Why is C faster than Java: git vs JGit
101–106 of 106 posts
Re: Why is C faster than Java: git vs JGit
#102I 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.
Re: Why is C faster than Java: git vs JGit
#103Earlier quoted context omitted.
Off-topic but relevant: I've been looking for info on just how database software does what it does. Ie from parsing the SQL query to hitting the disk, and everything in between. Anyone got any links or books?
Gray and Reuter's Transaction Processing is absolutely superb, and it covers a good part of this stack, everything lower-level than query planning. However, it covers every approach to doing this. If you want to know how Postgres, say, does it, that's a lot less information, and may be more digestible.
Re: Why is C faster than Java: git vs JGit
#104Earlier quoted context omitted.
There are also details and examples at http://www.sqlite.org/vdbe.html Things have changed a bit since then, but not much. SQLite's API is very different than regular databases because it is a library operating in the same process. In particular it does not calculate all result rows for a query up front (that wouldn't be very 'Lite') but instead calculates the next matching row as you ask for it. Consequently the int…
In particular it does not calculate all result rows for a query up front (that wouldn't be very 'Lite') but instead calculates the next matching row as you ask for it. That sounds like SQL cursors?
Virtually all other database engines calculate the query results up front. It is more effective in their implementations to do it that way. For example they will also calls to ask how many rows remain in the results. SQLite has no such API and the only way to find out is to actually retrieve each result row.
Re: Why is C faster than Java: git vs JGit
#105Earlier quoted context omitted.
Yep. The usual "Program X is faster in C than Java" gets a barrage of "That's because you know C better". Shawn is a performance-obsessed Java expert, Eclipse committer and longtime Google coder who works on JGit. If he says Java is slower than C at this, then Java is slower than C at this. EDIT: but as wcoenen points out, this was written in 2009 and Java 1.7 does a better job with some of this.
He's an expert you say? That was certainly not my expectation from the article. (1) Blind faith in Generics. This alone screams newb to me. He says that he got better performance with a custom data structure (no shit sherlock) but then seems deeply surprised by this. Duh. Okay, well, obviously he's relatively new to Java, but hey, he could still be a performance expert. (2) Never mentions the biggest weapon in the C…
In case if you are the expert, I would assume that he wouldn't mind if you have any insights to tune in the performance of JGit even further. You can start by joining in the mailing list.
He wasn't quantifying anything since he was not answering your question, he was sharing his experience.