Files
UnrealEngineUWP/Engine/Source/Programs/TestPAL
Michael Sartain af33ef1517 Implement better Linux CreateGuid using SYS_getrandom (if available)
Getrandom syscall was introduced in version Linux kernel v3.17.

Can be disabled with -norandomguids command line option.

On my Ubuntu 18.04 test machine[**], single threaded perf is slightly slower,
but performance with multiple threads improves:

  With Threads: 1, Calls: 1000000
    FGenericPlatformMisc::CreateGuid: 0.316885 seconds
    FPlatformMisc::CreateGuid:        0.544386 seconds

  With Threads: 8, Calls: 1000000
    FGenericPlatformMisc::CreateGuid: 5.867290 seconds
    FPlatformMisc::CreateGuid:        3.035365 seconds

  With Threads: 16, Calls: 1000000
    FGenericPlatformMisc::CreateGuid: 10.914646 seconds
    FPlatformMisc::CreateGuid:         5.897632 seconds

[**]
  4.15.0-45-generic
  Intel(R) Xeon(R) Gold 6134 CPU @ 3.20GHz)

Guids with getrandom() appear to be significantly more random:
 0 GuidGeneric:{4240FA8F-08D6-974C-F710-112EB0D1AB97} GuidPlatform:{F49E1FFA-67A1-4702-B065-6E1B6385BC5E}
 1 GuidGeneric:{4241444E-08D6-974C-F710-1296B0D1ABB9} GuidPlatform:{77D96835-24F5-4A27-B9E7-70985316285F}
 2 GuidGeneric:{4242B446-08D6-974C-F710-13CCB0D1ABD9} GuidPlatform:{80C46DF2-6DD1-4B27-B1BD-CC279B5874A0}
 3 GuidGeneric:{424386A9-08D6-974C-F710-1502B0D1ABF8} GuidPlatform:{5DA06154-78A5-47BB-A9A6-75B220950F31}
 4 GuidGeneric:{424436F2-08D6-974C-F710-1638B0D1AC17} GuidPlatform:{880670CF-0ABF-491F-80A4-91C28B6D5B2F}

#jira UE-4447
#codereview Arciel.Rekman, Brandon.Schaefer
#review-5097118 @Arciel.Rekman, @Brandon.Schaefer
#fyi Chris.Babcock
#rb Arciel.Rekman, Brandon.Schaefer

[CL 5110574 by Michael Sartain in Dev-Editor branch]
2019-02-21 12:43:01 -05:00
..