Assembly generated with only an include

Issue #327 resolved
Darcy Beurle created an issue

Hi Klaus,

I noticed that assembly code from the statics in the random class is generated when not using any random functionality (paying for what I don’t use 😉), see https://godbolt.org/z/QRKKhY. Out of curiosity, is there a workaround for this? Perhaps forcing the user to provide the seed at std::time(nullptr)? Pure inclusion of <random> doesn’t generate assembly.

Cheers!

Comments (5)

  1. Klaus Iglberger

    Hi Darcy!

    Thanks for creating this issue. You are absolutely correct, currently Blaze uses a global random number generator which causes this assembly output. Currently there is unfortunately not way to get rid of this behavior, but we’ll make sure that this overhead disappears as soon as possible. Thanks again,

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Commit 591f2d1 introduces the necessary changes that prevent code from being generated if no random functionality is used. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.7.

  3. Log in to comment