db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Derby Engine Architecture Qucik Overview
Date Tue, 17 Aug 2004 15:50:22 GMT
Hash: SHA1

Steen Jansdal wrote:
| Daniel John Debrunner wrote:
|> ~  1  parse using a parser generated by Javacc, results in a tree of
|> query nodes
| How is Javacc compared to ANTLR? How does the output from
| Javacc look like? The output from ANTLR is a nice looking
| readable java file that you can debug/single step through.
| Note: I have absolutely no experience with Javacc.

Cloudscape and now Derby have always used Javacc (from 1996), I have no
experience with ANTLR. I believe the code generated by Javacc could
be better, a simple sed script could clean up some items. It would
be interesting to try ANTLR, not sure how much work it would be.

|> ~  4  generation of a Java class (directly to byte code)  to represent
|> the statement plan
|> ~  5  loading of the class and creation of an instance to represent that
|> connection's state of the query
|> The generated statement plan is cached and can be shared by multiple
|> connections. DDL statements (e.g. CREATE TABLE use a common statement
|> plan to avoid generation of a Java class file)
| Interesting concept! How is the speed compared to a "normal"
| plan executer? The first couple of times the statement plan
| are executed, it would be interpreted. Only after a number
| of executions the hot spot compiler will decide to compile
| this into native code.

It has always been done this way, so there are no direct comparision
numbers. This concept arose around the original goal
to have a small footprint, thus using the JVM's interepter was thought
to be less code than having an internal one. It does benefit from the
JIT as you say, running performance tests will see a boost after a
number of iterations. In addition, calling into Java user-supplied
methods (functions & procedures) is direct, rather than through reflection.

| Is this concept also supported in J2ME?

Yes, we have run in modified J2ME environments, modified to have the
additional classes Derby requires (see the to-do list). None of those
are related to class generation.

Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


View raw message