zhulipeng opened a new pull request, #13819:
URL: https://github.com/apache/gluten/pull/13819

   ## What changes are proposed in this pull request?
   
   `libvelox.so` and `libgluten.so` export their symbols with default 
visibility, and neither is linked with `-Bsymbolic`. An exported function can 
be interposed by another library at runtime. So when one function in the 
library calls another exported, non-inlined function in the same library, the 
linker cannot bind the call directly. The call goes through a PLT stub, which 
loads the target address from the GOT and jumps to it indirectly. The extra 
indirect jump is cheap for a single call, but small hot functions such as 
`snappy::MemCopy64`, `snappy::DeferMemCopy` and `DecodedVector::isNullAt` are 
called billions of times per query, so the overhead adds up. In `perf` on TPC-H 
/ TPC-DS SF300, PLT stubs alone take 2.4% / 2.0% of all cycles.
   
   This PR links both libraries with `-Wl,-Bsymbolic-functions`. Only function 
binding changes. Data symbols, including `STB_GNU_UNIQUE` function-local 
statics, keep their normal binding, so libgluten and libvelox still share 
singletons such as `getJniErrorState()`. `JUMP_SLOT` relocations drop from 
29342 to 929 in `libvelox.so` and from 7408 to 247 in `libgluten.so`.
   
   ## How was this patch tested?
   
   TPC-H / TPC-DS SF300 on an Intel Xeon 6960P, 3 interleaved runs per build:
   
   - TPC-H total -3.6% (q19 -8.4%, q1 -6.1%, q18 -4.3%, …)
   - TPC-DS total -3.3% (q80 -9.7%, q76 -8.3%, q28 -7.4%, …)
   - No query is slower beyond noise. Query results match the baseline.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


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