Commit Graph

24 Commits

Author SHA1 Message Date
Andrew Trick
8f84429565 Add a scale-test for VarDecl::getStoredProperties.
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.
2019-05-13 16:54:55 -07:00
Slava Pestov
93c386d263 Parse: Skip function bodies when delayed member parsing mode is on
Fixes <rdar://problem/47305142>.
2019-01-18 00:15:53 -05:00
Rintaro Ishizaki
22652f9e88 [Parse] Eliminate backtracking in collection expression parsing
Parsing collection literal expression used to take exponential time
depending on the nesting level of the first element.

Stop using 'parseList()' because using it complicates libSyntax parsing.

rdar://problem/45221238 / https://bugs.swift.org/browse/SR-9220
rdar://problem/38913395 / https://bugs.swift.org/browse/SR-7283
2018-12-25 11:05:23 +09:00
Andrew Trick
8de89c392a Add a scale-test validation test for quadratic behavior during inlining.
Adds a stat to SILInstruction's transferNodesFromList to record the
number of times an instruction is transfered to another block. This is
the only way I can think of to detect quadratic behavior of passes
that split basic blocks.
2018-11-26 15:24:41 -08:00
Slava Pestov
4ab28fb63c Add scale test for nested type extension binding
This performance problem was fixed a while ago by Doug's request
evaluator work.
2018-09-14 14:31:46 -07:00
Xi Ge
3f03202ba7 test: add a scale test for the number of IterableDeclContext getting parsed. 2018-09-12 14:20:56 -07:00
Slava Pestov
47c6117a9b Sema: Remove deprecated SWIFT_FUNC_STAT counters 2018-03-06 19:42:52 -08:00
Slava Pestov
6065168928 Parse: Test that we only parse function bodies in primary files
I added this optimization a while ago but didn't add a test for it.
2018-03-06 19:42:43 -08:00
Slava Pestov
3f51dbc3b1 Sema: Don't validate types when binding extensions 2017-11-15 21:55:55 -08:00
Slava Pestov
772bd7634c Sema: Lazily validate protocol members 2017-11-15 16:26:27 -08:00
Slava Pestov
31176d713a Sema: Only validate all members of a class if we access one of its members
... Or if we subclass it, or define an extension of it.
2017-10-22 20:05:01 -07:00
Max Moiseev
fe4553eb80 Merge branch 'master' into new-integer-protocols 2017-04-11 17:07:11 -07:00
Huon Wilson
3f712ad87c [scale-test] Diagnose exponential growth explicitly.
This, somewhat questionably, fits the polynomial model and the
exponential model, and then chooses the one with the best R^2. However,
no matter how statistically valid this is, it works reasonably in
practice.

Slow growing things sometimes get classified as 1.0^n or 1.1^n, but
these are either spurious or not relevant, and so a similar thresholding
to the polynomial fit is used.
2017-04-10 13:22:16 -07:00
Max Moiseev
8ffbc81239 Fixing some validation tests 2017-03-10 17:09:28 -08:00
Slava Pestov
20b13bde5f scale_tests require an asserts build 2017-01-08 23:54:01 -08:00
Slava Pestov
02185c30ee Sema: When validating members for layout, skip certain members
For all types, we can safely skip nested nominal types and
typealiases.

For a struct, we only have to look at VarDecls; methods never
affect layout.

Similarly for an enum, only EnumElementDecls matter.

For a class, we still have to look at all methods and properties.
Ideally, in non-optimized builds we would invoke virtual methods
by calling thunks, and only emit the thunks from the translation
unit containing the class. Then the layout of a class will
only be necessary if you subclass the class.

This should improve compiler scalability in multiple-frontend
mode.
2017-01-08 21:01:14 -08:00
Slava Pestov
8d46ec4713 Actually enable scale-tests 2017-01-08 18:12:48 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Graydon Hoare
a5c1fb4e2a [Compile Perf] Add scale-test for BasicCalleeAnalysis, rdar://29279532 2016-11-17 11:58:58 -08:00
Graydon Hoare
1769325ec1 [Compile perf] Make scale-test conditional on assertions, rdar://29090287 2016-11-08 09:52:10 -08:00
Graydon Hoare
3d8f8e050c [Compile perf] Use lit tmpdir in scale-test, rdar://29090287 2016-11-07 15:57:33 -08:00
Ben Langmuir
9d441fc3d7 Disable compiler_scale test failing in CI
rdar://problem/29090287
2016-11-05 09:49:51 -07:00
Graydon Hoare
63f5a4b3ba Restrict scale-test to macosx, avoid breaking simulators. 2016-11-03 09:24:16 -07:00
Graydon Hoare
e2a7a891ff [Compile perf] rdar://27397701 Add multifile accessor scale-test 2016-11-02 10:00:18 -07:00