chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse
https://doc.chdb.io
Apache License 2.0
1.85k stars 71 forks source link

Integrate Profile-Guided Optimization (PGO) #124

Open zamazan4ik opened 8 months ago

zamazan4ik commented 8 months ago

Description

Recently I checked Profile-Guided Optimization (PGO) improvements on many projects. All current results are available here. E.g. ClickHouse PGO results can be checked here, ClickHouse documentation about building with PGO - https://clickhouse.com/docs/en/operations/optimizing-performance/profile-guided-optimization . According to the multiple tests, PGO can help with improving performance in many cases (including databases). That's why I think trying to optimize chdb with PGO can be a good idea.

I can suggest the following action points:

Since the chdb native part is the library, I think the Pydantic-core experience can be reused here. Also, Clang supports PGO for shared libraries.

Maybe testing Post-Link Optimization techniques (like LLVM BOLT) would be interesting too (Clang and Rustc already use BOLT as an addition to PGO) but I recommend starting from the usual PGO.

Here are some examples of how PGO optimization is integrated in other projects:

auxten commented 8 months ago

Thanks for all these infos, I'll have a try.