dzamlo / rust-testu01

A rust wrapper to a small subset of TestU01
GNU General Public License v3.0
0 stars 3 forks source link

Feature request: statically-linked version #2

Open Pr0methean opened 10 months ago

Pr0methean commented 10 months ago

At https://github.com/Pr0methean/ShiftStripe/actions/runs/7366198251/job/20048235812, the BigCrush runs would probably be much faster if the callbacks to the PRNG could be inlined, which would be possible through plugin LTO if TestU01 could be statically linked.

dzamlo commented 10 months ago

I can add a feature that add kind = "static" to the link statements if this what you mean?

dzamlo commented 10 months ago

Can you try to add RUSTFLAGS='-L /usr/local/lib -l static=testu01' to your cargo invocation ? This should do it.

Pr0methean commented 10 months ago

I ultimately determined that for my use-case, I needed to rebuild TestU01 from source anyway, because LTO only works when TestU01 and the Rust code are compiled with the same version of clang. I also learned that the real cause of my performance issues was https://github.com/rust-lang/portable-simd/issues/11 (since my inner loop does 2 lookups in a [u64; 6]).