Performance

Questo contenuto viene visualizzato in inglese perché non è ancora disponibile una versione tradotta nella lingua selezionata. Aiutaci a tradurre questo articolo!

 
L'interaccia Performance fornisce l'accesso alle informazioni relative alle performance della pagina corrente. Fa parte delle High Resolution Time API, ma viene migliorata tramite le Performance Timeline API, le Navigation Timing API, le User Timing API e le Resource Timing API.

Un oggetto di questo tipo può essere ottenuto chiamando Window.performance in sola lettura.

NotaQuesta interfaccia ed i suoi metodi sono disponibili nei Web Workers, ad eccezione di dove diversamente indicato nella guida sottostante.
Da notare inoltre che i markers delle peformance e le misurazioni sono relative al contesto. Se crei un marker sul thread principale (o su un altro worker), non potrai vederlo in un thread del worker e viceversa.

Proprietà

L'interfaccia Performance non eredita nessuna proprietà.

Performance.navigation Read only
PerformanceNavigation è un oggetto che fornisce un utile contesto sulle operazioni incluse nella lista timing, sia che la pagina venga caricata o ricaricata, quante occorrenze di redirect sono presenti e così via. Not available in workers.
  Performance.timing Read only
L'oggetto PerformanceTiming contiene le informazioni relative alla latenza delle performance. Not available in workers.
performance.memory
Estensione non-standard aggiunta in Chrome, questa proprietà fornisce un oggetto con l'utilizzo della memoria di base. Non dovresti usare questa API non-stanrdard.
Performance.timeOrigin Read only  
Restituisce il timestamp preciso del momento in cui si è iniziato a misurare le performance.

Event handlers

Performance.onresourcetimingbufferfull
Un EventTarget che funge da callback e che viene eseguito quando viene scatenato l'evento resourcetimingbufferfull

Metodi

L'interfaccia Performance non eredita nessun metodo.

Performance.clearMarks()
Rimuove il segnaposto specificato dal buffer delle performance del browser.
Performance.clearMeasures()
Rimuove la misurazione specificata dal buffer delle performance del browser.
Performance.clearResourceTimings()
Rimuove tutte le performance entries con un entryType di resource dal data buffer delle performance del browser.
Performance.getEntries()
Restituisce una lista di oggetti di tipo PerformanceEntry  basati sul filtro specificato.
Performance.getEntriesByName()
Restituisce una lista di oggetti di tipo PerformanceEntry secondo il nome specificato ed il tipo divoce specificata.
Performance.getEntriesByType()
Restituisce una list di oggetti PerformanceEntry relativi alla voce specificata
Performance.mark()
Crea un timestamp nel buffer delle performance usando il nome specificato.
Performance.measure()
Crea un timestamp nel buffer delle performance del browser tra due segnaposti (indicati rispettivamente come start mark ed end mark)
Performance.now()
Restituisce un DOMHighResTimeStamp ceh rappresenta il numero in millisecondi trascorso dall'istante preso come riferimento.
Performance.setResourceTimingBufferSize()
Imposta la dimensione del buffer del browser relativo alla temporizzazione in un numero specificato di oggetti performance entry "resourcetype
Performance.toJSON()
Restituisce un oggetto json che rappresenta l'oggetto Performance

Specifiche

Specifica Stato Commento
High Resolution Time Level 3
The definition of 'timeOrigin' in that specification.
Editor's Draft Definisce la proprietà timeOrigin 
High Resolution Time Level 2
The definition of 'toJSON()' in that specification.
Candidate Recommendation Definisce il metodo toJson() .
High Resolution Time
The definition of 'Performance' in that specification.
Recommendation Definisce il metodo now() .
Performance Timeline Level 2
The definition of 'Performance extensions' in that specification.
Candidate Recommendation Cambia l'interfaccia getEntries() .
Performance Timeline
The definition of 'Performance extensions' in that specification.
Recommendation Definisce i metodi getEntries(), getEntriesByType()getEntriesByName() .
Resource Timing Level 1
The definition of 'Performance extensions' in that specification.
Candidate Recommendation Definisce i metodi clearResourceTimings()setResourceTimingBufferSize() e la proprietà onresourcetimingbufferfull .
User Timing Level 2
The definition of 'Performance extensions' in that specification.
Working Draft Spiega i metodi mark(), clearMark(), measure() e clearMeasure() .
User Timing
The definition of 'Performance extensions' in that specification.
Recommendation Definisce i metodi mark(), clearMark(), measure() e clearMeasure().

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
PerformanceChrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 7Opera Android Full support 14Safari iOS Full support 9Samsung Internet Android ?
clearMarksChrome Full support 29
Full support 29
No support 25 — 29
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support 41IE Full support 10Opera Full support 33Safari Full support 11WebView Android Full support YesChrome Android Full support 29
Full support 29
No support 25 — 29
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 42Opera Android Full support 33Safari iOS Full support 11Samsung Internet Android ?
clearMeasuresChrome Full support 29
Full support 29
No support 25 — 29
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support 41IE Full support 10Opera Full support 33Safari Full support 11WebView Android Full support YesChrome Android Full support 29
Full support 29
No support 25 — 29
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 42Opera Android Full support 33Safari iOS Full support 11Samsung Internet Android ?
clearResourceTimingsChrome Full support 46
Full support 46
No support 22 — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support 11WebView Android Full support 46
Full support 46
No support ? — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 46
Full support 46
No support 25 — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 11Samsung Internet Android ?
getEntriesChrome Full support 28
Full support 28
No support 25 — 36
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support YesIE Full support YesOpera No support NoSafari Full support 11WebView Android Full support YesChrome Android Full support 28
Full support 28
No support 25 — 36
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 25Opera Android No support NoSafari iOS Full support 11Samsung Internet Android ?
getEntriesByNameChrome Full support 28
Full support 28
No support 25 — 36
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support YesIE Full support YesOpera No support NoSafari Full support 11WebView Android Full support YesChrome Android Full support 28
Full support 28
No support 25 — 36
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 25Opera Android No support NoSafari iOS Full support 11Samsung Internet Android ?
getEntriesByTypeChrome Full support 28
Full support 28
No support 25 — 36
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support YesIE Full support YesOpera Full support 15
Full support 15
No support 15 — 23
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari Full support 11WebView Android Full support YesChrome Android Full support 28
Full support 28
No support 25 — 36
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 25Opera Android Full support 15
Full support 15
No support 14 — 24
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS Full support 11Samsung Internet Android ?
markChrome Full support 28
Full support 28
No support 25 — 28
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support 41IE Full support 10Opera Full support 33Safari Full support 11WebView Android Full support YesChrome Android Full support 28
Full support 28
No support 25 — 28
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 42Opera Android Full support 33Safari iOS Full support 11Samsung Internet Android ?
measureChrome Full support 28
Full support 28
No support 25 — 28
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support 41IE Full support 10Opera Full support 33Safari Full support 11WebView Android Full support 46Chrome Android Full support 28
Full support 28
No support 25 — 28
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 42Opera Android Full support 33Safari iOS Full support 11Samsung Internet Android ?
memory
Non-standard
Chrome Full support 7Edge ? Firefox No support NoIE ? Opera Full support YesSafari No support NoWebView Android Full support YesChrome Android Full support 18Firefox Android No support NoOpera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
navigation
Deprecated
Chrome Full support 10Edge Full support 12Firefox Full support 7IE Full support 9Opera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 7Opera Android No support NoSafari iOS Full support 9Samsung Internet Android ?
nowChrome Full support 24
Full support 24
No support 21 — 24
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support 15
Notes
Full support 15
Notes
Notes In Firefox 57.0.4 the accuracy was reduced to 20 microseconds.
Notes In Firefox 59 the accuracy was reduced to 2 milliseconds.
Notes In Firefox 60 the accuracy was increased to 1 millisecond.
IE Full support 10Opera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 15
Notes
Full support 15
Notes
Notes In Firefox 57.0.4 the accuracy was reduced to 20 microseconds.
Notes In Firefox 59 the accuracy was reduced to 2 milliseconds.
Notes In Firefox 60 the accuracy was increased to 1 millisecond.
Opera Android Full support 14Safari iOS Full support 9Samsung Internet Android ?
onresourcetimingbufferfullChrome Full support 46
Full support 46
No support 22 — 57
Alternate Name
Alternate Name Uses the non-standard name: onwebkitresourcetimingbufferfull
Edge ? Firefox Full support YesIE No support NoOpera No support NoSafari Full support 11WebView Android Full support 46
Full support 46
No support ? — 57
Alternate Name
Alternate Name Uses the non-standard name: onwebkitresourcetimingbufferfull
Chrome Android Full support 46
Full support 46
No support 25 — 57
Alternate Name
Alternate Name Uses the non-standard name: onwebkitresourcetimingbufferfull
Firefox Android Full support YesOpera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
resourcetimingbufferfull eventChrome Full support 46
Full support 46
No support 22 — 57
Alternate Name
Alternate Name Uses the non-standard name: webkitresourcetimingbufferfull
Edge ? Firefox Full support YesIE No support NoOpera No support NoSafari Full support 11WebView Android Full support 46
Full support 46
No support ? — 57
Alternate Name
Alternate Name Uses the non-standard name: webkitresourcetimingbufferfull
Chrome Android Full support 46
Full support 46
No support 25 — 57
Alternate Name
Alternate Name Uses the non-standard name: webkitresourcetimingbufferfull
Firefox Android Full support YesOpera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
setResourceTimingBufferSizeChrome Full support 46
Full support 46
No support 22 — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support 11WebView Android Full support 46
Full support 46
No support ? — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 46
Full support 46
No support 25 — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support YesOpera Android Full support YesSafari iOS No support NoSamsung Internet Android ?
timeOrigin
Experimental
Chrome Full support 62Edge Full support 16Firefox Full support 53IE ? Opera Full support 49Safari No support NoWebView Android Full support 62Chrome Android Full support 62Firefox Android Full support 53Opera Android Full support 46Safari iOS No support NoSamsung Internet Android ?
timing
Deprecated
Chrome Full support 6Edge Full support 12Firefox Full support 7IE Full support 9Opera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 7Opera Android Full support 14Safari iOS Full support 9Samsung Internet Android ?
toJSONChrome Full support 56Edge Full support 12Firefox Full support 25IE ? Opera No support NoSafari No support NoWebView Android Full support 56Chrome Android Full support 56Firefox Android Full support 25Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.
Uses a non-standard name.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.