commit | 6a60296ca7ca9cc4705e62e22f6a0164b59452e3 | [log] [tgz] |
---|---|---|
author | Bruce Dawson <brucedawson@chromium.org> | Fri Apr 26 00:53:52 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Apr 26 00:53:52 2019 |
tree | 58a835f8551c94c73aacb71ee8c4f012a96c52c2 | |
parent | 51eeb5e52adee36cec79d1e80613e63838d8260d [diff] |
Use 31 instead of 15-bit int for temp dir names unit_tests creates two temporary directories for each test process. When run with --test-launcher-batch-limit=1 this means about 21,800 directories, 10,900 of each naming pattern. This is a problem because CreateTemporaryDirInDir uses a 15-bit random number to generate directory names. After we have generated just 214 names there is a greater than 50% probability of a collision and after 10,900 names there will have been thousands of collisions. These collisions are handled but they harm startup performance (especially when running with --test-launcher-batch-limit=1) and if we add enough tests or if directory cleanup isn't perfect then the slowdown can go asymptotic. Using a GUID would avoid all collisions but causes failures because a GUID is 36 characters - 31 longer - and we sometimes have nested temp directories. The extra 62 characters hits path length limits. Using 31-bit ints means the dir names are only 5 characters longer. Bug: 955038, 956723 Change-Id: Id8d921eba0a59a3e4031470ccb5ae5368f6144db Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584743 Commit-Queue: Robert Liao <robliao@chromium.org> Reviewed-by: Robert Liao <robliao@chromium.org> Cr-Commit-Position: refs/heads/master@{#654287}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .