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 tried to populate it during `CreatePlan` and then realized that I could only allocate the strings lazily. However, there's nothing stopping me from hoisting the data structure itself to the `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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org