Xiao-zhen-Liu commented on issue #9566:
URL: https://github.com/apache/texera/issues/9566#issuecomment-7049621198

   From my experience, the first run on a fresh computing unit has had a 
noticeable warmup delay for a long time, even after the computing unit is 
already up and connected.
   
   At startup, `ComputingUnitMaster` warms Jackson for operator JSON metadata 
(`warmupObjectMapperForOperatorsSerde` from #3504, which shortened the delay 
from clicking **Run** to **Submitting**), starts the Pekko actor system, and 
connects to Postgres, while leaving most of the execution stack untouched until 
the first run:
   - **Iceberg catalog and file I/O initialization**: `ComputingUnitMaster` 
does not initialize Iceberg at startup. On the first run, 
`ExecutionStatsService` and `RegionExecutionManager` call 
`DocumentFactory.createDocument`, which builds and caches the Iceberg catalog 
(`IcebergCatalogInstance.getInstance`, loading S3 or Hadoop file I/O and 
initializing the configured catalog) for subsequent runs. `LakeFSStorageClient` 
and `S3StorageClient` are also lazy singletons initialized on first use.
   - **Compiler, scheduler, and actor/RPC classloading**: `WorkflowCompiler`, 
`CostBasedScheduleGenerator`, `Coordinator`, `RegionExecutionManager`, 
`WorkflowWorker`, Kryo (`AmberKryoInitializer`), and ScalaPB control-RPC 
reflection all load and JIT-compile on the first run (and if **Run** is clicked 
right after unit startup, the background `ObjectMapper` warmup thread from 
#3504 may still be scanning operator classes).
   - **Mounted resources and Python workers**: For Python UDFs with mounted 
dataset or model parameters, `RepositoryMountManager.ensureMounted` requests 
the FUSE mount and polls every 200 ms on the first run, while later runs on the 
same unit return immediately once mounted. Any Python operator also spawns a 
new Python subprocess (`PythonWorkflowWorker`) on every run, with cold 
container file reads on the first run.
   
   Timing those sub-steps separately on both a small JVM-only workflow and one 
with a Python operator (while also separating 
`WorkflowService.initExecutionService`'s prior-run cleanup on Run 2 and the 
editor's 150 ms `FORM_DEBOUNCE_TIME_MS` before sending 
`WorkflowExecuteRequest`) should show exactly where the first-run warmup goes.
   


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