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
It is now worthwhile to interrogate the performance of some of the underlying data structures and algorithms for this project.
@brianlheim cooked up a really nice XCTestCase subclass for testing the linear complexity of a given operation over a given data structure, prepared in a given way.
I think this could be abstracted even further, making it painless to add performance tests in parallel to logic tests.
finalclassMeasuring<T>{enumResult{case success
case failure(expected:Complexity, result:String)}enumComplexity{case constant
case logarithmic
case linear
case quasiLinear
case quadratic
case cubic
case exponential
case factorial
}varresource:Tinit(_ resource:T, setUp:((inoutT)->Void)?=nil){self.resource = resource
setUp?(&self.resource)}@discardableResultfunc assertComplexity <U>(
_ complexity:Complexity,
setUp:((inoutT)->Void)?=nil,
for operation:(T)->U)->Measuring{
// assert ...
returnself}
The text was updated successfully, but these errors were encountered:
It is now worthwhile to interrogate the performance of some of the underlying data structures and algorithms for this project.
@brianlheim cooked up a really nice
XCTestCase
subclass for testing the linear complexity of a given operation over a given data structure, prepared in a given way.I think this could be abstracted even further, making it painless to add performance tests in parallel to logic tests.
The text was updated successfully, but these errors were encountered: