DanielLeens opened a new issue, #13591:
URL: https://github.com/apache/seatunnel/issues/13591

   ## Problem
   
   `AbstractJdbcRowConverter.toInternal()` and `toExternal()` rebuild 
`TableSchema.toPhysicalRowDataType()` for every row even while the same table 
schema is reused. The projection creates two stream pipelines/arrays and a new 
`SeaTunnelRowType`, whose constructor defensively copies its arrays. Retaining 
the TableSchema-based API is important; repeatedly rebuilding the same 
immutable physical layout is avoidable work.
   
   The calls were introduced by #5957 
(`1cc1b1b8cdff8072ad51dcf354781d5a44b2f0b9`). The relevant converter and API 
implementations are unchanged between the prior benchmark source 
`ee0fb0d72f67edbcd6caf08360fd354fa68e002f` and current dev 
`5cf050be3ffc77c0065d67d4eb8af83f24a2a620`.
   
   ## Diagnostic evidence
   
   A complete-engine MySQL-to-MySQL diagnostic using the prior pinned source, 
1,000,000 rows x19 declared fields, one writer, a 1000-row batch, Java11 and a 
1GiB heap attributed approximately **3.08GB of TLAB-weighted allocation 
estimates** to stacks containing `AbstractSchema.toPhysicalRowDataType()`. Its 
stack appeared in 119/3191 execution samples. These are sampled allocation/CPU 
indicators, not exact live-heap usage or a percentage of wall-clock time. Both 
diagnostic engines passed exact value reconciliation and used private/loopback 
connections.
   
   A fresh current-dev JDBC module has been built for the non-profiled 
acceptance comparison. No final DataX-relative speedup is claimed from the 
diagnostic recording; profile overhead and the legacy/current artifacts are 
recorded separately.
   
   ## Proposed bounded change
   
   Reuse one physical-layout entry per JDBC converter, keyed by schema 
identity. Replace the entry when a different schema arrives. Keep it transient, 
safely published, bounded to the last schema, and independent of row values. 
Avoid a static cache, ThreadLocal or unbounded schema map. Leave the existing 
virtual conversion hooks, target-column metadata lookups, field order, NULL 
handling and PreparedStatement bindings unchanged.
   
   ## Acceptance
   
   - Preserve values/types/field order and NULL bindings while alternating 
schemas, changing types under the same field names, serializing a warmed 
converter, and overlapping conversions.
   - Extend existing converter tests and an existing real-JDBC IT rather than 
adding an unrelated test framework.
   - Run scoped Spotless, compilation/verification, affected tests and real 
JDBC reconciliation.
   - Compare complete engines using the same frozen million-row data, driver, 
parallelism, batch/transaction settings and heap. Use warmup plus at least 
three alternating, non-profiled pairs for a final throughput claim. The ongoing 
campaign targets SeaTunnel throughput greater than DataX, and any remaining gap 
must be reported explicitly.
   - Preserve existing APIs, defaults, data semantics and dependencies; no POM 
changes. Keep any compatibility or performance limitations explicit.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to