Performance
Measure, analyze, and optimize application performance.
Eg performance
Interfaces
Deno supports User Timing Level 3 which is not widely supported yet in other runtimes.
Encapsulates a single performance metric that is part of the performance
timeline. A performance entry can be directly created by making a performance
mark or measure (for example by calling the .mark() method) at an explicit
point in an application.
PerformanceMark is an abstract interface for PerformanceEntry objects
with an entryType of "mark". Entries of this type are created by calling
performance.mark() to add a named DOMHighResTimeStamp (the mark) to the
performance timeline.
Options which are used in conjunction with performance.mark. Check out the
MDN
performance.mark()
documentation for more details.
PerformanceMeasure is an abstract interface for PerformanceEntry objects
with an entryType of "measure". Entries of this type are created by calling
performance.measure() to add a named DOMHighResTimeStamp (the measure)
between two marks to the performance timeline.
Options which are used in conjunction with performance.measure. Check out the
MDN
performance.mark()
documentation for more details.
Observes performance measurement events and is notified of new
PerformanceEntry objects as they are recorded.
A list of PerformanceEntry objects passed to a
PerformanceObserver callback.
Detailed network timing data for the fetching of a resource, an entry in
the performance timeline with an entryType of "resource".
Type Aliases
Variables
The global Performance instance, providing access to
high-resolution timing via performance.now() and the user-timing marks and
measures APIs.
interface Performance
Deno supports User Timing Level 3 which is not widely supported yet in other runtimes.
Check out the Performance API documentation on MDN for further information about how to use the API.
Methods #
#mark(markName: string,options?: PerformanceMarkOptions,): PerformanceMark Stores a timestamp with the associated name (a "mark").
#measure(measureName: string,options?: PerformanceMeasureOptions,): PerformanceMeasure Stores the DOMHighResTimeStamp duration between two marks along with the
associated name (a "measure").
Properties #
#timeOrigin: number Returns a timestamp representing the start of the performance measurement.
Methods #
#clearMarks(markName?: string): void Removes the stored timestamp with the associated name.
#clearMeasures(measureName?: string): void Removes stored timestamp with the associated name.
#clearResourceTimings(): void Removes all performance entries with an entryType of "resource" from the performance timeline and sets the size of the performance resource data buffer to zero.
Note: Deno does not currently track resource timings, so this method has no observable effect. It is provided for API compatibility.
#setResourceTimingBufferSize(maxSize: number): void Sets the desired size of the browser's resource timing buffer which stores the "resource" performance entries.
Note: Deno does not currently track resource timings, so this method has no observable effect. It is provided for API compatibility.
#getEntriesByName(name: string,type?: string,): PerformanceEntryList #getEntriesByType(type: string): PerformanceEntryList #mark(markName: string,options?: PerformanceMarkOptions,): PerformanceMark Stores a timestamp with the associated name (a "mark").
#measure(measureName: string,options?: PerformanceMeasureOptions,): PerformanceMeasure Stores the DOMHighResTimeStamp duration between two marks along with the
associated name (a "measure").
#measure(measureName: string,startMark?: string,endMark?: string,): PerformanceMeasure Stores the DOMHighResTimeStamp duration between two marks along with the
associated name (a "measure").
Returns a current time from Deno's start in fractional milliseconds.
const t = performance.now();
console.log(`${t} ms since start!`);
variable Performance
The constructor object for Performance.
The Performance instance is accessed via the global performance
property rather than constructed directly, so calling the constructor throws.
Type #
globalThis extends { document: any; Performance: infer T; } ? T : { readonly prototype: Performance; } interface PerformanceEntry
variable PerformanceEntry
Encapsulates a single performance metric that is part of the performance
timeline. A performance entry can be directly created by making a performance
mark or measure (for example by calling the .mark() method) at an explicit
point in an application.
Type #
globalThis extends { document: any; PerformanceEntry: infer T; } ? T : { readonly prototype: PerformanceEntry; } interface PerformanceMark
variable PerformanceMark
PerformanceMark is an abstract interface for PerformanceEntry objects
with an entryType of "mark". Entries of this type are created by calling
performance.mark() to add a named DOMHighResTimeStamp (the mark) to the
performance timeline.
Type #
globalThis extends { document: any; PerformanceMark: infer T; } ? T : { readonly prototype: PerformanceMark; } interface PerformanceMarkOptions
Options which are used in conjunction with performance.mark. Check out the
MDN
performance.mark()
documentation for more details.
Properties #
interface PerformanceMeasure
PerformanceMeasure is an abstract interface for PerformanceEntry objects
with an entryType of "measure". Entries of this type are created by calling
performance.measure() to add a named DOMHighResTimeStamp (the measure)
between two marks to the performance timeline.
Properties #
variable PerformanceMeasure
PerformanceMeasure is an abstract interface for PerformanceEntry objects
with an entryType of "measure". Entries of this type are created by calling
performance.measure() to add a named DOMHighResTimeStamp (the measure)
between two marks to the performance timeline.
Type #
globalThis extends { document: any; PerformanceMeasure: infer T; } ? T : { readonly prototype: PerformanceMeasure; } interface PerformanceMeasureOptions
Options which are used in conjunction with performance.measure. Check out the
MDN
performance.mark()
documentation for more details.
Properties #
Timestamp to be used as the start time or string to be used as start mark.
Properties #
Timestamp to be used as the start time or string to be used as start mark.
interface PerformanceObserver
Observes performance measurement events and is notified of new
PerformanceEntry objects as they are recorded.
Methods #
#disconnect(): void variable PerformanceObserver
Observes performance measurement events and is notified of new
PerformanceEntry objects as they are recorded.
Type #
globalThis extends { document: any; PerformanceObserver: infer T; } ? T : { readonly prototype: PerformanceObserver; readonly supportedEntryTypes: readonly string[]; } interface PerformanceObserverCallback
The callback invoked when observed performance entries are recorded.
Call Signatures #
(list: PerformanceObserverEntryList,observer: PerformanceObserver,): void interface PerformanceObserverEntryList
A list of PerformanceEntry objects passed to a
PerformanceObserver callback.
Methods #
#getEntriesByName(name: string,type?: string,): PerformanceEntry[] #getEntriesByType(type: string): PerformanceEntry[] variable PerformanceObserverEntryList
A list of PerformanceEntry objects passed to a
PerformanceObserver callback.
Type #
globalThis extends { document: any; PerformanceObserverEntryList: infer T; } ? T : { readonly prototype: PerformanceObserverEntryList; } interface PerformanceResourceTiming
variable PerformanceResourceTiming
Detailed network timing data for the fetching of a resource, an entry in
the performance timeline with an entryType of "resource".
Type #
globalThis extends { document: any; PerformanceResourceTiming: infer T; } ? T : { readonly prototype: PerformanceResourceTiming; } type alias PerformanceEntryList
Definition #
variable performance
The global Performance instance, providing access to
high-resolution timing via performance.now() and the user-timing marks and
measures APIs.
Type #
globalThis extends { document: any; performance: infer T; } ? T : Performance