Skip to content
Snippets Groups Projects
Commit d3a20a4b authored by Daniel's avatar Daniel
Browse files

DOC MAINT: Notes on benchmarking, renaming variable.

parent 394cad63
No related branches found
No related tags found
No related merge requests found
......@@ -11,3 +11,31 @@ Benchmarking can be done using the `TransactionBenchmark` class (in package
- To work with the benchmarks of often used objects, use these methods:
- `Container.getTransactionBenchmark().addBenchmark()`
- `Query.addBenchmark()`
# Miscellaneous Notes #
Notes to self, details, etc.
## On method calling order and benchmarked events ##
- `Transaction.execute()` :: Logs benchmarks for events like:
- `INIT`
- `PRE_CHECK`
- `CHECK`
- `POST_CHECK`
- `PRE_TRANSACTION`
- `TRANSACTION` -> typically calls
`database.backend.transaction.[BackendTransaction].execute()`, which in turn
calls, some levels deeper, `backend.transaction.....execute(<k extends
BackendTransaction> t)` -> see next point
- ...
- `backend.transaction.....execute(transaction)` :: This method is benchmarked
again, this is probably the deepest level of benchmarking. It finally calls
`[MySQLTransaction].execute()`.
- `[MySQLTransaction].execute()` :: This is the deppest backend implementation
part, it typically creates a prepared statement and executes it.
- Currently not benchmarked separately:
- Getting the actual implementation (probably fast?)
- Preparing the SQL statement
- Executing the SQL statement
- Java-side caching
......@@ -43,10 +43,10 @@ public class MySQLRetrieveSparseEntity extends MySQLTransaction
@Override
public SparseEntity execute(final int id) throws TransactionException {
try {
final PreparedStatement prepareStatement = prepareStatement(stmtStr);
final PreparedStatement preparedStatement = prepareStatement(stmtStr);
prepareStatement.setInt(1, id);
final ResultSet rs = prepareStatement.executeQuery();
preparedStatement.setInt(1, id);
final ResultSet rs = preparedStatement.executeQuery();
try {
return DatabaseUtils.parseEntityResultSet(rs);
} finally {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment