You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "lriggs (via GitHub)" <gi...@apache.org> on 2025/11/18 00:39:25 UTC

[I] [C++][Gandiva] Projector make is significantly slower after move to OrcJIT [arrow]

lriggs opened a new issue, #48159:
URL: https://github.com/apache/arrow/issues/48159

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   When building the Projector class in Gandiva there is approximately 4x slowness compared to a previous implementation.  Ultimately it is related to the new Orc JIT llvm engine.
   
   I modified the src/test/java/org/apache/arrow/gandiva/evaluator/MicroBenchmarkTest.java test in arrow-java to record the time spent in building the in Projector.make
   
   [GitHub - lriggs/arrow-java at arrow20_perf](https://github.com/lriggs/arrow-java/tree/arrow20_perf) 
   
   You can run the test like: arrow-java/gandiva$ mvn -Dtest=MicroBenchmarkTest test
   
   These times are just for making the projector and not evaluating the rows.
   
   The change between compilers: [GH-37848: [C++][Gandiva] Migrate LLVM JIT engine from MCJIT to ORC v2… · apache/arrow@83cba25](https://github.com/apache/arrow/commit/83cba25017a5c3a03e47f1851f242fa284f93533) 
   
    This test was done on the same Arrow 20 branch either with the above commit or with it reverted. I also updated llvm in between tests to reflect our necessary environment for running the Orc Jit version.
   
   **llvm 18 with old MCJIT**
   
   [INFO] Running org.apache.arrow.gandiva.evaluator.MicroBenchmarkTest
   Total Time taken for projecting 1m records of add3 is 28,386,796,426ms
   Average Time taken for projecting 1m records of add3 for 50000 iterations is 567,735ms
   
    
   
   **llvm 21 with new ORCJIT**
   [INFO] Running org.apache.arrow.gandiva.evaluator.MicroBenchmarkTest
   Total Time taken for projecting 1m records of add3 is 109,540,979,822ms
   Average Time taken for projecting 1m records of add3 for 50000 iterations is 2,190,819ms
   
    
   
   ### Component(s)
   
   C++


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++][Gandiva] Projector make is significantly slower after move to OrcJIT [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou closed issue #48159: [C++][Gandiva] Projector make is significantly slower after move to OrcJIT
URL: https://github.com/apache/arrow/issues/48159


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++][Gandiva] Projector make is significantly slower after move to OrcJIT [arrow]

Posted by "lriggs (via GitHub)" <gi...@apache.org>.
lriggs commented on issue #48159:
URL: https://github.com/apache/arrow/issues/48159#issuecomment-3573235237

   Some profiling I did.
   
   With the MCJIT engine it create one TargetMachine in llvm:
   <img width="1442" height="721" alt="Image" src="https://github.com/user-attachments/assets/2b90a5fc-8df0-4d88-98cc-0533e9b84d0b" />
   
   But after the changes to ORCJIT it is creating three:
   
   <img width="1481" height="760" alt="Image" src="https://github.com/user-attachments/assets/5353dc93-57ba-4ba0-9aca-0d1de7619828" />
   
   My testing and the llvm code seems to indicate this can be resource intensive.
   https://llvm.org/doxygen/JITTargetMachineBuilder_8h_source.html says `/// Get the default DataLayout for the target.
     ///
     /// Note: This is reasonably expensive, as it creates a temporary
     /// TargetMachine instance under the hood. It is only suitable for use during
     /// JIT setup.
     [Expected<DataLayout>](https://llvm.org/doxygen/classllvm_1_1Expected.html) [getDefaultDataLayoutForTarget](https://llvm.org/doxygen/classllvm_1_1orc_1_1JITTargetMachineBuilder.html#aae1a8efd4b4afe6411908938a204fa0b)() {`
   
   Only one target machine is created after a proposed refactoring:
   
   <img width="1459" height="841" alt="Image" src="https://github.com/user-attachments/assets/fb55ee5e-1706-44f4-8c36-cf84407c6334" />
   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++][Gandiva] Projector make is significantly slower after move to OrcJIT [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on issue #48159:
URL: https://github.com/apache/arrow/issues/48159#issuecomment-3822520486

   Issue resolved by pull request 49063
   https://github.com/apache/arrow/pull/49063


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org