# Purpose of ArrayValueProp benchmark

**URL:** <https://forums.swift.org/t/purpose-of-arrayvalueprop-benchmark/17469>\
**Category:** Compiler\
**Tags:** benchmarks\
**Created:** [October 29, 2018, 6:31pm UTC](https://forums.swift.org/t/purpose-of-arrayvalueprop-benchmark/17469 "2018-10-29T18:31:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [October 29, 2018, 6:31pm UTC](https://forums.swift.org/t/purpose-of-arrayvalueprop-benchmark/17469/1 "2018-10-29T18:31:52Z")

</div>

Looking at [`ArrayValueProp\*](https://github.com/apple/swift/blob/master/benchmark/single-source/ArrayLiteral.swift#L13) family of benchmarks, I'm unclear about their purpose. The description says:

```swift
// This test checks performance of creating array from literal and array value
// propagation.
// It is reported to be slow: <rdar://problem/17297449>

```

Could somebody please tell me what was that bug about?  
I'm a bit suspicious of the fact that all 4 variants are written as calls to corresponding `addLiteralArray*` function, but in the optimized mode (`-O`) these functions are all constant folded to just return single `Int` value and main benchmarking loops degenerate to 10\_000 method calls and integer additions. Is this what is meant by "array value propagation"?

---

<div class="post-metadata">

**Author:** ![lancep](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lancep/32/1509_2.png) [@lancep](https://forums.swift.org/u/lancep)\
**Post date:** [October 30, 2018, 8:38pm UTC](https://forums.swift.org/t/purpose-of-arrayvalueprop-benchmark/17469/2 "2018-10-30T20:38:54Z")

</div>

@Andrew_Trick would know, he filed the bug in question
