Skip to content

Commit 0188d27

Browse files
committed
Add a short description to the benchmark.
1 parent 8b6c6af commit 0188d27

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

benchmark/single-source/TypeFlood.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12+
//
13+
// We use this test to benchmark the runtime memory that Swift programs use.
14+
//
15+
// The Swift compiler caches the metadata that it needs to generate to support
16+
// code that checks for protocol conformance and other operations that require
17+
// use of metadata.
18+
// This mechanism has the potential to allocate a lot of memory. This benchmark
19+
// program generates 2^15 calls to swift_conformsToProtocol and fills the
20+
// metadata/conformance caches with data that we never free. We use this
21+
// program to track the runtime memory usage of swift programs. The test is
22+
// optimized away in Release builds but kept in Debug mode.
23+
1224

1325
import TestsUtils
1426
protocol Pingable {}

0 commit comments

Comments
 (0)