akasamq / akasa

A high performance, low latency and high extendable MQTT server(broker) in Rust
MIT License
124 stars 9 forks source link

Evaluate Profile-Guided Optimization (PGO) and LLVM BOLT #3

Open zamazan4ik opened 9 months ago

zamazan4ik commented 9 months ago

Hi!

Recently I did many Profile-Guided Optimization (PGO) benchmarks on multiple projects (including many network-related projects like Envoy, HAProxy, etc.) - the results are available here. I think it could interesting to try to test PGO for optimizing the CPU part of Akasa.

I can suggest the following things to do:

Here are some examples of how PGO is already integrated into other projects' build scripts:

After PGO, I can suggest evaluating LLVM BOLT as an additional optimization step after PGO.

For the Rust projects, I recommend starting with cargo-pgo.

I understand that the project is in the earliest stages of its lifecycle. So just think about the issue as a possible idea for improvements.

TheWaWaR commented 9 months ago

Sounds like a very awesome technology to optimize the program.

I understand that the project is in the earliest stages of its lifecycle.

Yes, currently adding more features are more higher priority tasks, but I'll definitely try this once I start doing optimization.

Thanks for your introduction to PGO :)