You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say we have a struct Thing, which has a member number of type Int
I performed two tests designed to convert an array [Thing] to a dictionary [Int : Thing], where the keys are number values for the corresponding struct. Basically, indexing things by number.
The first method performs the indexing by accessing struct members with a closure passed as an argument.
The second method performs the indexing by accessing struct members with a keyPath passed as an argument.
This seems slower than expected. I wanted to bring the results of my test to light, as I found it surprising. Perhaps there is room to optimize the implementation of KeyPaths?
The text was updated successfully, but these errors were encountered:
Attachment: Download
Additional Detail from JIRA
md5: 0857d78cb9f33ab6cab8467269658cce
duplicates:
Issue Description:
Let's say we have a struct Thing, which has a member number of type Int
I performed two tests designed to convert an array [Thing] to a dictionary [Int : Thing], where the keys are number values for the corresponding struct. Basically, indexing things by number.
The first method performs the indexing by accessing struct members with a closure passed as an argument.
The second method performs the indexing by accessing struct members with a keyPath passed as an argument.
Turns out the keypath method takes nearly double the time to execute for 100000 Things.
This seems slower than expected. I wanted to bring the results of my test to light, as I found it surprising. Perhaps there is room to optimize the implementation of KeyPaths?
The text was updated successfully, but these errors were encountered: