| commit | d7d7f82729dd62c5c39154140bf1c6a54abdfe84 | [log] [tgz] |
|---|---|---|
| author | Stiopa Koltsov <stepan.koltsov@gmail.com> | Mon Nov 30 13:52:38 2020 -0800 |
| committer | Copybara-Service <copybara-worker@google.com> | Mon Nov 30 13:53:43 2020 -0800 |
| tree | 329dc4728cbe940e1606e2b9c3b9140000d40a48 | |
| parent | 67f9a94243e9aacd05a49cb5355663a283126a0d [diff] |
Starlark: optimze list(list)
Override `toArray(Object[])` in StarlarkList and Tuple
with an implementation more efficient than that of
AbstractCollection. Used by Starlark.toArray.
```
A: N=23 r=8.124+-0.325 se=0.069
B: N=23 r=6.613+-0.391 se=0.083
B/A: 0.814
```
for a benchmark
```
l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for i in range(50000000):
list(l)
```
Or for bundled benchmark:
```
benchmark ops cpu/op wall/op steps/op alloc/op
# before
bench_list_list 67108863 209ns 208ns 4 255B
# after
bench_list_list 67108863 174ns 173ns 4 223B
```
Closes #12515.
PiperOrigin-RevId: 344882064
{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