saipubw 1c06165c9b
[libc++] Make std::align an inline function (#167472)
`std::align` is heavily used in memory allocators. When we attempted to
switch from libstdc++ to libc++, we observed a **50%** performance
regression in a database query bench: the issue is that `std::align` in
libc++ is not an inline function, which prevents the compiler from
performing inlining optimizations.

make `std::align` an inline function will run about 2x faster. See
[benchmark
result](https://quick-bench.com/q/wPTnt9JCGn2S-3bu5gY9YrEf6KU).

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-12-18 17:55:28 +08:00
..