evgenyigumnov / cblt

Safe and fast minimalistic web server, written in Rust, that serves files from a directory and proxies requests to another server.
MIT License
40 stars 7 forks source link

Evaluate additional optimizations like LTO and PGO #5

Closed zamazan4ik closed 2 weeks ago

zamazan4ik commented 2 weeks ago

Hi!

Regarding LTO the issue is pretty much the same as this one: https://github.com/evgenyigumnov/rustsn/issues/53 - just enable LTO for the Release profile. It will likely improve the project's performance and the binary size: according to my tests, at least the binary size is dropped from 9.2 Mib to 7.4 Mib.

Regarding Profile-Guided Optimization (PGO) and similar techniques like Post-Link Optimization (PLO) (with tools like LLVM BOLT - I highly recommend to take a look on them since according to my tests PGO helps to achieve better performance for proxies in C and Rust. If your aim is to squeeze as much performance as possible - definitely worth testing.

Thanks!

evgenyigumnov commented 2 weeks ago

https://github.com/evgenyigumnov/cblt/commit/9ccdcb63a9155d1567ee407053dc949aa17b8529

zamazan4ik commented 2 weeks ago

If you are interested in testing PGO for the project, I can kindly suggest renaming the issue title and reopening the issue - then it would be a good sign for the community that you don't reject the PGO idea for cblt.

evgenyigumnov commented 2 weeks ago

Ok, sounds good. Create new ticket with this please