SQL/MX Programming Manual for Java

Introduction
HP NonStop SQL/MX Programming Manual for Java523726-003
1-7
Steady-State Performance
Steady-State Performance
Steady-state performance is based on how long it takes a long-running server to
complete its operation after it starts and reaches a steady-state mode.
Steady-State Performance of JDBC/MX Programs
A well-written JDBC program compiles each of its SQL statements only once for each
process instance (or thread). After the statements are compiled for that process
instance (or thread), the performance penalty disappears. There is no difference
between the execution time of a dynamically-compiled plan versus a statically-
compiled plan. In other words, the performance penalty of preparing each statement in
a JDBC program occurs only at startup.
Steady-State Performance of SQLJ Programs
For long running servers, JDBC programs perform slightly better than SQLJ programs.
Long-running SQLJ programs are slightly slower because they execute in the SQLJ
run time. The SQLJ run time is implemented as a layer on top of JDBC with hooks that
enable JDBC to load and execute statically compiled plans. The time spent in the
SQLJ run-time layer causes an SQLJ program in steady state to run slightly less
quickly than an equivalent JDBC program.
When to Choose SQLJ Versus JDBC
Follow these guidelines when choosing between SQLJ and JDBC based on
performance:
When startup performance is important, choose SQLJ. When steady-state
performance is important, choose JDBC:
For more information, see Startup Performance on page 1-6 and Steady-State
Performance on page 1-7.
Consider how the program is written and how it functions:
There are other reasons for choosing between SQLJ and JDBC aside from
performance. For more information, see SQLJ Compared With JDBC on page 1-4.
SQLJ Program JDBC/MX Program
Startup Performance
faster slower
Steady-State Performance slower
faster
Use SQLJ Use JDBC/MX
The program has many complex
SQL statements.
Yes No
The program starts and stops
frequently.
Yes No
The program runs for a long time. No
Yes