| commit | e77cf0229db79f3b18e5a0a4934b09360ccc175b | [log] [tgz] |
|---|---|---|
| author | jmmv <jmmv@google.com> | Thu Jul 12 02:20:04 2018 -0700 |
| committer | Copybara-Service <copybara-piper@google.com> | Thu Jul 12 02:21:12 2018 -0700 |
| tree | c732bab18bfd4a8f72fb10c8545b20024feffd5f | |
| parent | 1fdcd74798a3ed44bcfc90e22b4c65d59765aa82 [diff] |
Make spend_cpu_time more reliable by tracking time. First, make the function that wastes user time keep track of how much processor time has been used so far, and make the function that wastes system time track overall wall time. This is to minimize the number of "overhead" system calls, which can tamper with our measurements. Second, make the loop of the function that wastes user time more costly so that modern processors don't run it too fast. Otherwise, the overhead to track used time becomes significant in system time and makes our tests fail. This should fix the flakiness observed in our process-wrapper tests when run on the modern CPUs that the iMac Pros carry. Tested: I haven't been able to reproduce the flakiness. Running the spend_cpu_time binary by hand reports very accurate timings for both system and user time, even when pausing the program while it runs. RELNOTES: None. PiperOrigin-RevId: 204264910
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel only rebuilds what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md
Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.