mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Adds a NumStoredPropertiesQueries stat. Adds a test case for an increasing number of lazy stored class properties. Each property requires a formal access within the initializer. This would manifest as cubic behavior in AccessEnforcementOpts, which scales as O(1.5) in the above stat.
17 lines
506 B
Plaintext
17 lines
506 B
Plaintext
// RUN: %scale-test -O --begin 5 --end 21 --step 5 --select NumStoredPropertiesQueries %s
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: asserts
|
|
//
|
|
// Single file with many stored properties.
|
|
//
|
|
// Check that SIL passes don't exhibit cubic behavior by repeatedly
|
|
// asking for all the stored properties (if the
|
|
// NumStoredPropertiesQueries stat scales quadratically, then the
|
|
// behavior is cubic).
|
|
|
|
public class LazyProperties {
|
|
%for i in range(N):
|
|
public lazy var prop${i}: String = { return "${i}" }()
|
|
%end
|
|
}
|