Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOTimeProfile Class Reference

#include <OOJSEngineTimeManagement.h>

+ Inheritance diagram for OOTimeProfile:
+ Collaboration diagram for OOTimeProfile:

Instance Methods

(double) - totalTime
 
(double) - javaScriptTime
 
(double) - nativeTime
 
(double) - extensionTime
 
(double) - nonExtensionTime
 
(double) - profilerOverhead
 
(NSArray *) - profileEntries
 
(void) - dealloc [implementation]
 
(NSString *) - description [implementation]
 
(void) - setTotalTime: [implementation]
 
(void) - setNativeTime: [implementation]
 
(void) - setExtensionTime: [implementation]
 
(void) - setProfilerOverhead: [implementation]
 
(void) - setProfileEntries: [implementation]
 
(jsval) - oo_jsValueInContext: [implementation]
 
(NSDictionary *) - propertyListRepresentation [implementation]
 

Private Attributes

double _totalTime
 
double _nativeTime
 
double _extensionTime
 
double _profilerOverhead
 
NSArray * _profileEntries
 

Detailed Description

Definition at line 112 of file OOJSEngineTimeManagement.h.

Method Documentation

◆ dealloc

- (void) dealloc
implementation

Definition at line 591 of file OOJSEngineTimeManagement.m.

619{
621
622 [super dealloc];
623}
#define DESTROY(x)
Definition OOCocoa.h:77

◆ description

- (NSString *) description
implementation

Definition at line 591 of file OOJSEngineTimeManagement.m.

627{
628 double totalTime = [self totalTime];
629
630 NSMutableString *result = [NSMutableString stringWithFormat:
631 @"Total time: %g ms\n"
632 "JavaScript: %g ms, native: %g ms\n"
633 "Counted towards limit: %g ms, excluded: %g ms\n"
634 "Profiler overhead: %g ms",
635 totalTime * 1000.0,
636 [self javaScriptTime] * 1000.0, [self nativeTime] * 1000.0,
637 [self nonExtensionTime] * 1000.0, [self extensionTime] * 1000.0,
638 [self profilerOverhead] * 1000.0];
639
640 NSArray *profileEntries = [self profileEntries];
641 NSUInteger i, count = [profileEntries count];
642 if (count != 0)
643 {
644 [result appendString:@"\n NAME T COUNT TOTAL SELF TOTAL% SELF% SELFMAX"];
645 for (i = 0; i < count; i++)
646 {
647 // [result appendFormat:@"\n %@", [_profileEntries objectAtIndex:i]];
648
649 OOTimeProfileEntry *entry = [profileEntries objectAtIndex:i];
650
651 double totalPc = [entry totalTimeSum] * 100.0 / totalTime;
652 double selfPc = [entry selfTimeSum] * 100.0 / totalTime;
653
654 [result appendFormat:@"\n%60s %c%7lu %8.2f %8.2f %5.1f %5.1f %8.2f",
655 [[entry function] UTF8String],
656 [entry isJavaScriptFrame] ? 'J' : 'N',
657 (unsigned long)[entry hitCount], [entry totalTimeSum] * 1000.0, [entry selfTimeSum] * 1000.0, totalPc, selfPc, [entry selfTimeMax] * 1000.0];
658 }
659 }
660
661 return result;
662}
unsigned count

◆ extensionTime

- (double) extensionTime

Definition at line 591 of file OOJSEngineTimeManagement.m.

708{
709 return _extensionTime;
710}

◆ javaScriptTime

- (double) javaScriptTime

Definition at line 591 of file OOJSEngineTimeManagement.m.

678{
679#ifdef MOZ_TRACE_JSCALLS
680 return _javaScriptTime;
681#else
682 return _totalTime - _nativeTime;
683#endif
684}

◆ nativeTime

- (double) nativeTime

Definition at line 591 of file OOJSEngineTimeManagement.m.

696{
697 return _nativeTime;
698}

◆ nonExtensionTime

- (double) nonExtensionTime

Definition at line 591 of file OOJSEngineTimeManagement.m.

720{
721 return _totalTime - _extensionTime;
722}

◆ oo_jsValueInContext:

- (jsval) oo_jsValueInContext: (JSContext *) context
implementation

Definition at line 591 of file OOJSEngineTimeManagement.m.

753 :(JSContext *)context
754{
756}
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
NSDictionary * propertyListRepresentation()

◆ profileEntries

- (NSArray *) profileEntries

Definition at line 591 of file OOJSEngineTimeManagement.m.

738{
739 return _profileEntries;
740}

◆ profilerOverhead

- (double) profilerOverhead

Definition at line 591 of file OOJSEngineTimeManagement.m.

726{
727 return _profilerOverhead;
728}

◆ propertyListRepresentation

- (NSDictionary *) propertyListRepresentation
implementation

Provided by category OOTimeProfile(Private).

Definition at line 591 of file OOJSEngineTimeManagement.m.

760{
761 NSArray *profileEntries = [self profileEntries];
762 NSMutableArray *convertedEntries = [NSMutableArray arrayWithCapacity:[profileEntries count]];
763 NSEnumerator *entryEnum = nil;
764 OOTimeProfileEntry *entry = nil;
765 for (entryEnum = [profileEntries objectEnumerator]; (entry = [entryEnum nextObject]); )
766 {
767 [convertedEntries addObject:[entry propertyListRepresentation]];
768 }
769
770 return [NSDictionary dictionaryWithObjectsAndKeys:
771 profileEntries, @"profiles",
772 [NSNumber numberWithDouble:[self totalTime]], @"totalTime",
773 [NSNumber numberWithDouble:[self javaScriptTime]], @"javaScriptTime",
774 [NSNumber numberWithDouble:[self nativeTime]], @"nativeTime",
775 [NSNumber numberWithDouble:[self extensionTime]], @"extensionTime",
776 [NSNumber numberWithDouble:[self nonExtensionTime]], @"nonExtensionTime",
777 [NSNumber numberWithDouble:[self profilerOverhead]], @"profilerOverhead",
778 nil];
779}
return nil
NSDictionary * propertyListRepresentation()

◆ setExtensionTime:

- (void) setExtensionTime: (double) value
implementation

Provided by category OOTimeProfile(Private).

Definition at line 591 of file OOJSEngineTimeManagement.m.

713 :(double)value
714{
715 _extensionTime = value;
716}

Referenced by OOJSEndProfiling().

+ Here is the caller graph for this function:

◆ setNativeTime:

- (void) setNativeTime: (double) value
implementation

Provided by category OOTimeProfile(Private).

Definition at line 591 of file OOJSEngineTimeManagement.m.

701 :(double)value
702{
703 _nativeTime = value;
704}

Referenced by OOJSEndProfiling().

+ Here is the caller graph for this function:

◆ setProfileEntries:

- (void) setProfileEntries: (NSArray *) value
implementation

Provided by category OOTimeProfile(Private).

Definition at line 591 of file OOJSEngineTimeManagement.m.

743 :(NSArray *)value
744{
745 if (_profileEntries != value)
746 {
747 [_profileEntries release];
748 _profileEntries = [value retain];
749 }
750}

Referenced by OOJSEndProfiling().

+ Here is the caller graph for this function:

◆ setProfilerOverhead:

- (void) setProfilerOverhead: (double) value
implementation

Provided by category OOTimeProfile(Private).

Definition at line 591 of file OOJSEngineTimeManagement.m.

731 :(double)value
732{
733 _profilerOverhead = value;
734}

Referenced by OOJSEndProfiling().

+ Here is the caller graph for this function:

◆ setTotalTime:

- (void) setTotalTime: (double) value
implementation

Provided by category OOTimeProfile(Private).

Definition at line 591 of file OOJSEngineTimeManagement.m.

671 :(double)value
672{
673 _totalTime = value;
674}

Referenced by OOJSEndProfiling().

+ Here is the caller graph for this function:

◆ totalTime

- (double) totalTime

Definition at line 591 of file OOJSEngineTimeManagement.m.

666{
667 return _totalTime;
668}

Member Data Documentation

◆ _extensionTime

- (double) _extensionTime
private

Definition at line 117 of file OOJSEngineTimeManagement.h.

◆ _nativeTime

- (double) _nativeTime
private

Definition at line 116 of file OOJSEngineTimeManagement.h.

◆ _profileEntries

- (NSArray*) _profileEntries
private

Definition at line 124 of file OOJSEngineTimeManagement.h.

◆ _profilerOverhead

- (double) _profilerOverhead
private

Definition at line 122 of file OOJSEngineTimeManagement.h.

◆ _totalTime

- (double) _totalTime
private

Definition at line 115 of file OOJSEngineTimeManagement.h.


The documentation for this class was generated from the following files: