mbutrovich commented on code in PR #1029:
URL: https://github.com/apache/datafusion-comet/pull/1029#discussion_r1814900680


##########
native/core/src/execution/jni_api.rs:
##########
@@ -346,6 +347,10 @@ pub unsafe extern "system" fn 
Java_org_apache_comet_Native_executePlan(
 
         let exec_context_id = exec_context.id;
 
+        // We maintain a map of metrics name -> jstring object to reduce the 
overhead of calling
+        // jni_NewStringUTF repeatedly.
+        let mut metrics_jstrings: HashMap<String, Arc<GlobalRef>> = 
HashMap::new();

Review Comment:
   Yep I think I can do that. I originally went down that path and then tried 
to populate it during `CreatePlan` and then realized that I could only allocate 
the strings lazily. However, there's nothing stopping me from still doing the 
first part and stashing it in `ExecutionContext`. I do wonder about thread 
safety though.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to