Describe the enhancement requested
The Orc Jit component of LLVM is more modern and supported by the community, compared to MCJit which is being phased out. The change was made here to switch engines: GH-37848: [C++][Gandiva] Migrate LLVM JIT engine from MCJIT to ORC v2… · apache/arrow@83cba25
At Dremio we've observed a 30% reduction in throughput which has been attributed to the LLVM engine update. This was verified by building and testing version of the Arrow Gandiva jars with and without that change only.
It isn't feasible or desirable to go back to the older engine. The Orc Jit engine is designed to be more modular and usable but that introduces more overhead when creating and destroying the engine internals.
I haven't researched this thoroughly but there may be ways (caching, shared instances, longer lifespan) to tune how LLVM is used with Gandiva which avoids some of the construction costs.
Component(s)
Gandiva