commit | b0b7e53f5d1a4cc7ab45dfb64d86f0afc387b843 | [log] [tgz] |
---|---|---|
author | Stiopa Koltsov <stepan.koltsov@gmail.com> | Mon Nov 16 15:00:25 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Nov 16 15:02:35 2020 -0800 |
tree | 0a3955b3ec1516116595738bb7ec47f989a558d1 | |
parent | 7d52cc518d6b56b8cab90059f68e808e60f96346 [diff] |
Starlark: microoptimize str[index] Preallocate single-char ASCII strings. ``` def test(): for i in range(1000000): s = "abcdefghijklmnopqrstuvwxyz" for j in range(len(s)): s[j] test() ``` ``` A: N=48, r=3.896+-0.475 B: N=48, r=3.516+-0.571 B/A: 0.902 ``` Closes #12490. PiperOrigin-RevId: 342728476
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only 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