You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add a simple benchmark for statement parser
Also fixes the pom to run the annotation processor so that
mvn -Pbenchmark actually is able to run benchmarks.
* Optimize AbstractStatementParser.statementStartsWith
I found this was taking ~25% of the CPU of pgadapter when running
the TPCC benchmark loader, which seems to generate very large DMLs.
Previously, it would call split() over the whole string with
a limit. Now, it uses Guava's lazy splitter so that it doesn't
have to copy the remainder of the string following the second
match.
For whatever reason, it seems like the previous implementation
was doing something much more expensive than just copying the
tail. For 100kb long query text, this new implementation is
1600x faster. For short queries it's only a few times faster.
Before:
Benchmark Mode Cnt Score Error Units
StatementParserBenchmark.isQueryTest thrpt 5 1461962.835 ± 340237.573 ops/s
StatementParserBenchmark.longQueryTest thrpt 5 2873.150 ± 490.611 ops/s
After:
Benchmark Mode Cnt Score Error Units
StatementParserBenchmark.isQueryTest thrpt 5 4765215.378 ± 132661.232 ops/s
StatementParserBenchmark.longQueryTest thrpt 5 4671884.683 ± 486566.506 ops/s
* perf: further micro optimizations to parser
* fix: remove supportsExplain
The `supportsExplain()` method did not actually do anything useful and
returned the wrong result. The reason that it was not useful is that:
1. Parsers that do support the EXPLAIN keyword handle these as client-side statements.
This means that they never go into the isQuery() method.
2. Parsers that do not support the EXPLAIN keyword cannot do anything with it anyways.
* build: register clirr difference
---------
Co-authored-by: Knut Olav Løite <[email protected]>
0 commit comments