twalthr commented on code in PR #29418:
URL: https://github.com/apache/flink/pull/29418#discussion_r4207697564


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/CodeGenOperatorFactory.java:
##########
@@ -36,9 +37,13 @@ public CodeGenOperatorFactory(GeneratedClass<? extends 
StreamOperator<OUT>> gene
     @Override
     public <T extends StreamOperator<OUT>> T createStreamOperator(
             StreamOperatorParameters<OUT> parameters) {
+        final ClassLoader userCodeClassLoader =
+                parameters.getContainingTask().getUserCodeClassLoader();
+        // one-shot background Janino warm-up (the first cold compile on a TM 
is not sped up)
+        CompileUtils.warmUp();

Review Comment:
   Isn't this a bit late. shouldn't it be in a static block in CompileUtils



##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/generated/CompileUtils.java:
##########
@@ -73,6 +75,37 @@ public static void cleanUp() {
         COMPILED_EXPRESSION_CACHE.cleanUp();
     }
 
+    static final String WARM_UP_CLASS = "JaninoWarmUp";
+    static final String WARM_UP_CODE =
+            "public class JaninoWarmUp { public long eval(long a, long b) { 
return a + b; } }";
+
+    private static final AtomicBoolean WARMED_UP = new AtomicBoolean(false);
+
+    /**
+     * Compiles a throwaway class on a daemon thread so the Janino compiler is 
loaded and JIT-warmed

Review Comment:
   Did you test running it more than once? In earlier warm up scenarios I 
noticed improved JIT behavior after 10+ runs.



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