-
Enhancement
-
Resolution: Done
-
Major
-
1.6.0.Final
-
None
-
False
-
False
-
Undefined
-
Found few performance bottlenecks on benchmarking PostgreSQL CDC events. This Issue will focus on improving the ObjectMapper initialization (others will be filed as separate Issues).
`io.debezium.connector.postgresql.SourceInfo.sequence()` has a major performance bottleneck due to Initialization of `ObjectMapper` on every call (i.e., for every cdc row event). Pull Request will be raised with optimizing the `new ObjectMapper()` to `private static final` field.
JVisualVM Sampler metrics attached for 1M row CDC events on a table with 4 columns (NOOP DebeziumEngine.notifying)
.sequence() | Before | After | Diff |
---|---|---|---|
1M Rows | 2,879 ms (9.4%) | 256 ms (1.1%) | -88.9% x11.2 improvement |
Overall Performance improvement can range from approx `5% - 15%` depending upon row width (no of columns)
JMH Benchmarks
Benchmark Mode Cnt Score Error Units PostgresConnectorConfigPerf.benchmark_1_before thrpt 3 550040.596 ± 16847.245 ops/s PostgresConnectorConfigPerf.benchmark_2_after thrpt 3 4347346.228 ± 108381.634 ops/s