Skip to content

Create PGO optimized binaries #1469

Open
@YamatoSecurity

Description

@YamatoSecurity

I was able to get a 11.5% speed increase with PGO optimization. (Memory usage did not change)

cargo install cargo-pgo
rustup component add llvm-tools-preview
cargo pgo build
cargo pgo instrument --keep-profiles run csv-timeline -d ../hayabusa-sample-evtx -w -D -n -x -X -s -o delete.csv -C -p super-verbose
cargo pgo instrument --keep-profiles run json-timeline -d ../hayabusa-sample-evtx -w -D -n -x -X -s -o delete.csv -C -p super-verbose
cargo pgo instrument --keep-profiles run logon-summary -d ../hayabusa-sample-evtx  -o delete.csv -C
cargo pgo instrument --keep-profiles run eid-metrics -d ../hayabusa-sample-evtx -o delete.csv -C
cargo pgo optimize

Notes

  1. The optimized binary gets outputted at target/x86_64-apple-darwin/release/, etc... directories instead of ./target/release
  2. The profiles will differ based on workload, so we should probably be running the hayabusa commands against the hayabusa-sample-evtx files as well as the evtx-baseline files
  3. I still haven't tried optimization with BOLT although apparently rustc already does some optimizations so might not be necessary.
  4. The profiles are not getting created on Windows for some reason...

Info:

@fukusuket Whenever you have time, could you test to see if you get faster benchmarks as well? If so, I'd like to add to clone the release binary automation action and add PGO optimizations to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions