picks is an array of instances of an NSManagedObject subclass, position and pick_line are both optional Integer types. (I don't know if this is relevant).
Not sure if this should be labelled "Performance". Is that for issues in the compilation time or the performance of the compiled code.
The text was updated successfully, but these errors were encountered:
There are several factors that would make the first one slower, the main one being that everything's type-checked together. Specifically:
As a multi-statement closure, the body of the second is type-checked separately from the call to sort.
The types of the branches of the ternary operator must match, so it all gets type-checked together. We could probably separate out the checking for the condition, but we don't. The second version checks all three pieces separately, and uses the type pre-established by the call to sort.
Additional Detail from JIRA
md5: ff256899ba0f3da0f98368b68df0de47
Issue Description:
A function with this line took about 4 seconds to compile in debug.
This equivalent version took only 5.4ms:
picks
is an array of instances of an NSManagedObject subclass,position
andpick_line
are both optional Integer types. (I don't know if this is relevant).Not sure if this should be labelled "Performance". Is that for issues in the compilation time or the performance of the compiled code.
The text was updated successfully, but these errors were encountered: