RandUtil: Add Mersene Twister Enginer to thread's local storage to avoid
the overhead associated with seeding the generator.

One can do ~18 M (~26 M) calls per second when using
unifom_int_distribution on top of Mersene engine versus <1M (~ 8M) calls
per second when using the current implementation on POSIX and Windows,
respectively.

Note that these figures are obtained when the generator is seeded once,
otherwise the figure obtained for the suggested implementation would
be <1M (this is for POSIX, we don't have the figure for windows).
To that end, we use thread's local storage to seed the generator once.

Change-Id: I628d2e0ab882a9703e52b4007d53fa5cf49d4d47
Reviewed-on: https://chromium-review.googlesource.com/982115
Commit-Queue: Farah Charab <farahcharab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550496}

CrOS-Libchrome-Original-Commit: ac6125e471ac4ab9dbca3a43e68c1892b9ab71cc
3 files changed
tree: 4a98b5971db1ffaf81203318a05ec568e7e77d50
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/