Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/measure #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Test/measure #8

wants to merge 5 commits into from

Conversation

ytyubox
Copy link
Owner

@ytyubox ytyubox commented Mar 14, 2020

This PR Delete the Operator + and -, in case of the performance result.
Here's the result of struct for creating over 1_000_000 objects with 60 steps of assign.

1. PerformanceForAnonymousFunction

code

let _:TargetData = {
    var object = TargetData()
    object.value01 = value
    ...
}()

result

Test Case '-[FluentInterfaceTests.PerformanceTests testPerformanceForAnonymousFunction]' 
measured [Time, seconds]
average: 0.853, relative standard deviation: 6.228%,
values: [0.860029, 0.872155, 0.846942, 0.913310, 0.966266, 0.818084, 0.865597, 0.805299, 0.786005, 0.796726]

2. Test with FI but no operator

code:

_ =  FluentInterface(subject: TargetData())
       .value1(value)
       ....
       .unwrappingSubject()

result

Test Case '-[FluentInterfaceTests.PerformanceTests testPerformanceForFluentInterfaceWithoutOperator]' 
measured [Time, seconds]
average: 0.300, relative standard deviation: 1.791%,
values: [0.314669, 0.300544, 0.295156, 0.299124, 0.295934, 0.297903, 0.300905, 0.295507, 0.301754, 0.298032]

3. Test with both FI and operator

code

_ =  TargetData()+
       .value1(value)
       ....
       .unwrappingSubject()

result

Test Case '-[FluentInterfaceTests.PerformanceTests testPerformanceForFluentInterface]' 
measured [Time, seconds]
average: 31.903, relative standard deviation: 1.653%,
values: [31.434002, 32.345789, 31.874028, 32.196870, 32.072988, 31.607050, 32.087261, 31.928967, 32.762648, 30.725121]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant