Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-3770

Performance issue due to inefficient ObjectMapper initialization

XMLWordPrintable

    • 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
      

        1. after_optimization.png
          121 kB
          Naveen Kumar
        2. before_optimization.png
          122 kB
          Naveen Kumar

              Unassigned Unassigned
              krnaveen14 Naveen Kumar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: