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

DOC: Benchmarking

parent 57d3b5dd
No related branches found
No related tags found
No related merge requests found
# Manual Java-Side Benchmarking #
# Manual Java-side benchmarking #
Benchmarking can be done using the `TransactionBenchmark` class (in package
`caosdb.server.database.misc`).
......@@ -12,14 +12,14 @@ Benchmarking can be done using the `TransactionBenchmark` class (in package
- `Container.getTransactionBenchmark().addBenchmark()`
- `Query.addBenchmark()`
# Miscellaneous Notes #
# Miscellaneous notes #
Notes to self, details, etc.
## On method calling order and benchmarked events ##
- `Transaction.execute()` :: Logs benchmarks for events like:
- `INIT`
- `INIT` :: The transaction's `init()` method.
- `PRE_CHECK`
- `CHECK`
- `POST_CHECK`
......@@ -29,13 +29,42 @@ Notes to self, details, etc.
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
- `backend.transaction.[...].execute(transaction)` :: This method is benchmarked
again (via parent class `BackendTransaction`), this is probably the deepest
level of benchmarking currently (Benchmark is logged as
e.g. `<RetrieveFullEntity>...</>`). It finally calls
`[MySQLTransaction].execute()`.
- `[MySQLTransaction].execute()` :: This is the deppest backend implementation
- `[MySQLTransaction].execute()` :: This is the deepest 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
## Server settings ##
- To enable the SQL general logs, log into the SQL server and do:
```sql
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
```
- To enable transaction benchmarks and disable caching in the server, set these
server settings:
```conf
TRANSACTION_BENCHMARK_ENABLED=true
CACHE_DISABLE=true
```
- Additionally, the server should be started via `make run-debug` (instead of
`make run-single`), otherwise the benchmarking will not be active.
## Notable benchmarks and where to find them ##
| Name | Where measured | What measured |
|--------------------------------------|----------------------------------------------|-------------------------------|
| `Retrieve.init` | transaction/Transaction.java#135 | transaction/Retrieve.java#48 |
| `Retrieve.transaction` | transaction/Transaction.java#174 | transaction/Retrieve.java#133 |
| `Retrieve.post_transaction` | transaction/Transaction.java#182 | transaction/Retrieve.java#77 |
| `EntityResource.httpGetInChildClass` | resource/transaction/EntityResource.java#118 | all except XML generation |
| `ExecuteQuery` | ? | ? |
| | | |
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment