Cache std::random_device
ClosedPublic

Authored by poke1024 on Sep 20 2017, 5:37 PM.

Details

Summary

Creating or opening a std::random_device incurs an overhead one can see in profiling (about 7% on OS X; on Linux and OS X, this causes a call to open()).

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
poke1024 created this revision.Sep 20 2017, 5:37 PM
poke1024 edited the summary of this revision. (Show Details)Sep 20 2017, 9:16 PM
dkazakov accepted this revision.Sep 22 2017, 9:33 PM
dkazakov added a subscriber: dkazakov.

The patch looks fine. Perhaps we could also use some simpler random engine... Though I have no knowledge of that :)

This revision is now accepted and ready to land.Sep 22 2017, 9:33 PM

Hi, @poke1024!

Could you send me you email so I could push the patch under you name? To dimula73 at gmail dot com

This revision was automatically updated to reflect the committed changes.