Revise performance measurement naming and structure (#2265)

* Revise performance measurement naming and structure

- Revises naming from LayoutSpecGeneration to LayoutSpecComputation
- Adds a struct instead of an NSDictionary to retrieve performance metrics
- Includes ASEnvironmentStatePropagateDown in LayoutSpecComputation measurements

* Revise SumScopeTimer to include enable flag

* Make struct a typedef
This commit is contained in:
Harry Shamansky
2016-09-20 12:39:09 -07:00
committed by Adlai Holler
parent 5990376f68
commit 71fc2dd18d
4 changed files with 46 additions and 45 deletions

View File

@@ -38,16 +38,15 @@ ASDISPLAYNODE_EXTERN_C_END
*/
typedef NS_OPTIONS(NSUInteger, ASDisplayNodePerformanceMeasurementOptions) {
ASDisplayNodePerformanceMeasurementOptionLayoutSpec = 1 << 0,
ASDisplayNodePerformanceMeasurementOptionLayoutGeneration = 1 << 1
ASDisplayNodePerformanceMeasurementOptionLayoutComputation = 1 << 1
};
/**
* Keys to retrieve performance entries from the performance dictionary.
*/
extern NSString *const ASDisplayNodeLayoutSpecTotalTimeKey;
extern NSString *const ASDisplayNodeLayoutSpecNumberOfPassesKey;
extern NSString *const ASDisplayNodeLayoutGenerationTotalTimeKey;
extern NSString *const ASDisplayNodeLayoutGenerationNumberOfPassesKey;
typedef struct {
CFTimeInterval layoutSpecTotalTime;
NSInteger layoutSpecNumberOfPasses;
CFTimeInterval layoutComputationTotalTime;
NSInteger layoutComputationNumberOfPasses;
} ASDisplayNodePerformanceMeasurements;
@interface ASDisplayNode (Beta)
@@ -94,10 +93,9 @@ extern NSString *const ASDisplayNodeLayoutGenerationNumberOfPassesKey;
@property (nonatomic, assign) ASDisplayNodePerformanceMeasurementOptions measurementOptions;
/**
* @abstract A dictionary representing performance measurements collected.
* @note see the constants above to retrieve relevant performance measurements
* @abstract A simple struct representing performance measurements collected.
*/
@property (nonatomic, strong, readonly) NSDictionary *performanceMeasurements;
@property (nonatomic, assign, readonly) ASDisplayNodePerformanceMeasurements performanceMeasurements;
/** @name Layout Transitioning */