nzw921rx opened a new pull request, #13210:
URL: https://github.com/apache/seatunnel/pull/13210

   ### Purpose of this pull request
   
   Add `MultiTableSinkBenchmark.timerFlush` to measure the parallel timer flush 
path introduced by #13201.
   
   The benchmark uses a dedicated `TimerFlushSinkState` and fixture, separate 
from `recordHandoff`. It covers 1, 5, and 10 writer queues at trigger intervals 
of 100, 500, and 1000 ms. Each queue has two child writers, and each child 
writer simulates a 5 ms write wait for one buffered batch.
   
   JMH measures the time from invoking the registered flush callback to its 
return. Trigger pacing and verification that every child writer completed its 
flush run outside the timed section.
   
   ### Does this PR introduce any user-facing change?
   
   Developers can select `MultiTableSinkBenchmark` from the Benchmarks workflow 
dropdown. The class selector runs both `recordHandoff` and `timerFlush`, each 
with its own state.
   
   ### How was this patch tested?
   
   Ran JMH 1.37 on Temurin 11.0.33 with one benchmark thread and four pinned 
logical CPUs. Both revisions used the same benchmark sources. The table 
averages two runs per revision in baseline → candidate → candidate → baseline 
order.
   
   - Serial baseline: `535d4237`
   - Parallel candidate: `b0a0713a`, the merge snapshot of #13201 at head 
`d209c351`
   
   | Trigger interval (ms) | Writer queues | Serial (ms/round) | Parallel 
(ms/round) | Speedup |
   | ---: | ---: | ---: | ---: | ---: |
   | 100 | 1 | 10.319 | 10.310 | 1.00× |
   | 100 | 5 | 51.198 | 10.777 | 4.75× |
   | 100 | 10 | 102.138 | 10.999 | 9.29× |
   | 500 | 1 | 10.260 | 10.282 | 1.00× |
   | 500 | 5 | 51.084 | 10.861 | 4.70× |
   | 500 | 10 | 102.100 | 10.885 | 9.38× |
   | 1000 | 1 | 10.321 | 10.318 | 1.00× |
   | 1000 | 5 | 51.061 | 10.958 | 4.66× |
   | 1000 | 10 | 102.237 | 11.144 | 9.17× |
   
   Apply the benchmark commit to both revisions and run the following commands 
on each checkout.
   
   ```bash
   ./mvnw -Pbenchmark -pl seatunnel-benchmarks -am -DskipTests -Dskip.ui=true 
package
   
   taskset -c 0-3 java -jar seatunnel-benchmarks/target/benchmarks.jar \
     'MultiTableSinkBenchmark.timerFlush$' \
     -p flushIntervalMillis=100,500,1000 -p flushQueueCount=1,5,10 -p 
writerFlushMillis=5 \
     -t 1 -f 1 -wi 1 -w 1s -i 2 -r 2s -foe true \
     -jvmArgsAppend '-Xms512m -Xmx512m -XX:ActiveProcessorCount=4'
   ```
   
   The JDK 11 benchmark reactor `verify` passed, including all four 
`MultiTableSinkFixtureTest` cases. Both revisions passed the targeted 
MultiTable API tests. The shaded JAR ran `timerFlush`, the existing 
`recordHandoff` passed its smoke test, and all 32 benchmark driver tests 
passed. The full offline repository `verify` stopped at missing Flink 1.15.3 
dependencies.


-- 
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