From dfb8c72c3e775b4a763ad5c495756e2897a46847 Mon Sep 17 00:00:00 2001 From: skyclouds2001 Date: Mon, 29 Apr 2024 17:37:28 +0800 Subject: [PATCH] move --- files/en-us/_redirects.txt | 9 ++--- files/en-us/_wikihistory.json | 40 +++++++++---------- files/en-us/web/api/performance/index.md | 2 +- files/en-us/web/api/performance_api/index.md | 4 +- .../performance_api/performance_data/index.md | 2 +- files/en-us/web/api/window/index.md | 2 +- .../performance}/index.md | 16 +++++--- .../en-us/web/api/workerglobalscope/index.md | 2 +- .../workerglobalscope/performance/index.md | 33 +++++++++++++++ .../global_objects/date/gettime/index.md | 2 +- .../reference/global_objects/date/index.md | 2 +- files/jsondata/GroupData.json | 2 +- package.json | 3 +- 13 files changed, 78 insertions(+), 41 deletions(-) rename files/en-us/web/api/{performance_property => window/performance}/index.md (85%) create mode 100644 files/en-us/web/api/workerglobalscope/performance/index.md diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index e76c0266834d555..4e7bfc3da2cb101 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -2196,7 +2196,7 @@ /en-US/docs/DOM/window.outerHeight /en-US/docs/Web/API/Window/outerHeight /en-US/docs/DOM/window.outerWidth /en-US/docs/Web/API/Window/outerWidth /en-US/docs/DOM/window.parent /en-US/docs/Web/API/Window/parent -/en-US/docs/DOM/window.performance /en-US/docs/Web/API/performance_property +/en-US/docs/DOM/window.performance /en-US/docs/Web/API/Window/performance /en-US/docs/DOM/window.performance.now /en-US/docs/Web/API/Performance/now /en-US/docs/DOM/window.personalbar /en-US/docs/Web/API/Window/personalbar /en-US/docs/DOM/window.postMessage /en-US/docs/Web/API/Window/postMessage @@ -10210,7 +10210,6 @@ /en-US/docs/Web/API/Window/openDialog /en-US/docs/Web/API/Window /en-US/docs/Web/API/Window/pageXOffset /en-US/docs/Web/API/Window/scrollX /en-US/docs/Web/API/Window/pageYOffset /en-US/docs/Web/API/Window/scrollY -/en-US/docs/Web/API/Window/performance /en-US/docs/Web/API/performance_property /en-US/docs/Web/API/Window/removeEventListener /en-US/docs/Web/API/EventTarget/removeEventListener /en-US/docs/Web/API/Window/resolveLocalFileSystemURL /en-US/docs/Web/API/File_and_Directory_Entries_API#resolvelocalfilesystemurl() /en-US/docs/Web/API/Window/restore /en-US/docs/Web/API/Window/moveTo @@ -10303,7 +10302,7 @@ /en-US/docs/Web/API/WorkerGlobalScope.onlanguagechange /en-US/docs/Web/API/WorkerGlobalScope/languagechange_event /en-US/docs/Web/API/WorkerGlobalScope.onoffline /en-US/docs/Web/API/WorkerGlobalScope/offline_event /en-US/docs/Web/API/WorkerGlobalScope.ononline /en-US/docs/Web/API/WorkerGlobalScope/online_event -/en-US/docs/Web/API/WorkerGlobalScope.performance /en-US/docs/Web/API/performance_property +/en-US/docs/Web/API/WorkerGlobalScope.performance /en-US/docs/Web/API/WorkerGlobalScope/performance /en-US/docs/Web/API/WorkerGlobalScope.self /en-US/docs/Web/API/WorkerGlobalScope/self /en-US/docs/Web/API/WorkerGlobalScope/WorkerGlobalScope.caches /en-US/docs/Web/API/caches /en-US/docs/Web/API/WorkerGlobalScope/atob /en-US/docs/Web/API/atob @@ -10319,7 +10318,6 @@ /en-US/docs/Web/API/WorkerGlobalScope/onlanguagechange /en-US/docs/Web/API/WorkerGlobalScope/languagechange_event /en-US/docs/Web/API/WorkerGlobalScope/onoffline /en-US/docs/Web/API/WorkerGlobalScope/offline_event /en-US/docs/Web/API/WorkerGlobalScope/ononline /en-US/docs/Web/API/WorkerGlobalScope/online_event -/en-US/docs/Web/API/WorkerGlobalScope/performance /en-US/docs/Web/API/performance_property /en-US/docs/Web/API/WorkerGlobalScope/requestFileSystemSync /en-US/docs/Web/API/File_and_Directory_Entries_API /en-US/docs/Web/API/WorkerGlobalScope/setInterval /en-US/docs/Web/API/setInterval /en-US/docs/Web/API/WorkerGlobalScope/setTimeout /en-US/docs/Web/API/setTimeout @@ -10706,6 +10704,7 @@ /en-US/docs/Web/API/notification_1/vibrate /en-US/docs/Web/API/Notification/vibrate /en-US/docs/Web/API/onMSVideoOptimalLayoutChanged /en-US/docs/Web/API/HTMLVideoElement /en-US/docs/Web/API/onMSVideoOptimalLayoutChanged_ /en-US/docs/Web/API/HTMLVideoElement +/en-US/docs/Web/API/performance_property /en-US/docs/Web/API/Window/performance /en-US/docs/Web/API/range.cloneContents /en-US/docs/Web/API/range/cloneContents /en-US/docs/Web/API/range.cloneRange /en-US/docs/Web/API/range/cloneRange /en-US/docs/Web/API/range.collapse /en-US/docs/Web/API/range/collapse @@ -10887,7 +10886,7 @@ /en-US/docs/Web/API/window.outerHeight /en-US/docs/Web/API/Window/outerHeight /en-US/docs/Web/API/window.outerWidth /en-US/docs/Web/API/Window/outerWidth /en-US/docs/Web/API/window.parent /en-US/docs/Web/API/Window/parent -/en-US/docs/Web/API/window.performance /en-US/docs/Web/API/performance_property +/en-US/docs/Web/API/window.performance /en-US/docs/Web/API/Window/performance /en-US/docs/Web/API/window.performance.now /en-US/docs/Web/API/Performance/now /en-US/docs/Web/API/window.personalbar /en-US/docs/Web/API/Window/personalbar /en-US/docs/Web/API/window.postMessage /en-US/docs/Web/API/Window/postMessage diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index 1dd1489c6eae9ed..e94ce32f52556a6 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -67949,6 +67949,26 @@ "modified": "2020-10-15T22:16:14.230Z", "contributors": ["mfuji09", "wbamberg"] }, + "Web/API/Window/performance": { + "modified": "2020-10-15T21:22:10.802Z", + "contributors": [ + "sideshowbarker", + "connorshea", + "Sheppy", + "anonyco", + "kmag", + "sarafec", + "smarts", + "jsantell", + "fscholz", + "paul.irish", + "teoli", + "julienw", + "iamanupmenon", + "ethertank", + "MattBrubeck" + ] + }, "Web/API/Window/personalbar": { "modified": "2020-10-15T21:14:01.101Z", "contributors": [ @@ -71578,26 +71598,6 @@ "ziyunfei" ] }, - "Web/API/performance_property": { - "modified": "2020-10-15T21:22:10.802Z", - "contributors": [ - "sideshowbarker", - "connorshea", - "Sheppy", - "anonyco", - "kmag", - "sarafec", - "smarts", - "jsantell", - "fscholz", - "paul.irish", - "teoli", - "julienw", - "iamanupmenon", - "ethertank", - "MattBrubeck" - ] - }, "Web/API/queueMicrotask": { "modified": "2020-10-15T22:21:06.789Z", "contributors": [ diff --git a/files/en-us/web/api/performance/index.md b/files/en-us/web/api/performance/index.md index 8c1780d1a5f2533..fd4de6659bfe4f0 100644 --- a/files/en-us/web/api/performance/index.md +++ b/files/en-us/web/api/performance/index.md @@ -9,7 +9,7 @@ browser-compat: api.Performance The **`Performance`** interface provides access to performance-related information for the current page. -An object of this type can be obtained by calling `window.performance` or `self.performance` in workers. Note that Performance entries are per context. If you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. See [`self.performance`](/en-US/docs/Web/API/performance_property) for which APIs are available in window and worker contexts. +An object of this type can be obtained by calling `window.performance` or `self.performance` in workers. Note that Performance entries are per context. If you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. See {{domxref("window.performance")}} for which APIs are available in window and worker contexts. {{InheritanceDiagram}} diff --git a/files/en-us/web/api/performance_api/index.md b/files/en-us/web/api/performance_api/index.md index 7f3b8d786de984c..902151456caa3f1 100644 --- a/files/en-us/web/api/performance_api/index.md +++ b/files/en-us/web/api/performance_api/index.md @@ -29,7 +29,7 @@ Each performance metric is represented by a single {{domxref("PerformanceEntry") Most of the performance entries are recorded for you without you having to do anything, and are then accessible either through {{domxref("Performance.getEntries()")}} or (preferably) through {{domxref("PerformanceObserver")}}. For example, {{domxref("PerformanceEventTiming")}} entries are recorded for events that take longer than a set threshold. But the Performance API also enables you to define and record your own custom events, using the {{domxref("PerformanceMark")}} and {{domxref("PerformanceMeasure")}} interfaces. -The main {{domxref("Performance")}} interface is available for each global using {{domxref("performance_property", "self.performance")}} and enables you to add custom performance entries, to clear performance entries, and to retrieve performance entries. +The main {{domxref("Performance")}} interface is available for each global using {{domxref("Window.performance")}} or {{domxref("WorkerGlobalScope.performance")}} and enables you to add custom performance entries, to clear performance entries, and to retrieve performance entries. The {{domxref("PerformanceObserver")}} interface enables you to listen for various types of performance entry as they are recorded. @@ -50,7 +50,7 @@ The following interfaces are present in the Performance API: - {{domxref("LayoutShiftAttribution")}} - : Provides debugging information about elements which have shifted. - {{domxref("Performance")}} - - : Main interface to access performance measurements. Available to window and worker contexts using {{domxref("performance_property", "self.performance")}}. + - : Main interface to access performance measurements. Available to window and worker contexts using {{domxref("Window.performance")}} or {{domxref("WorkerGlobalScope.performance")}}. - {{domxref("PerformanceElementTiming")}} - : Measures rendering timestamps of specific elements. - {{domxref("PerformanceEntry")}} diff --git a/files/en-us/web/api/performance_api/performance_data/index.md b/files/en-us/web/api/performance_api/performance_data/index.md index f8a6f50ddb36e2a..ec11d66f845c97f 100644 --- a/files/en-us/web/api/performance_api/performance_data/index.md +++ b/files/en-us/web/api/performance_api/performance_data/index.md @@ -22,7 +22,7 @@ For some metrics you do have to tell the browser what to measure: ## Performance data structure -The Performance API collects performance data for each global object (`window.performance` or `self.performance` in workers). See [`self.performance`](/en-US/docs/Web/API/performance_property) for which APIs are available in window and worker contexts. If you are collecting performance metrics for multiple contexts, also take a look at [`performance.timeOrigin`](/en-US/docs/Web/API/Performance/timeOrigin) to synchronize time origins between contexts. +The Performance API collects performance data for each global object (`window.performance` or `self.performance` in workers). See {{domxref("window.performance")}} for which APIs are available in window and worker contexts. If you are collecting performance metrics for multiple contexts, also take a look at {{domxref("performance.timeOrigin")}} to synchronize time origins between contexts. Within these contexts, individual performance data is represented by performance entries. diff --git a/files/en-us/web/api/window/index.md b/files/en-us/web/api/window/index.md index 3107c90a671faab..461b8d1a2461722 100644 --- a/files/en-us/web/api/window/index.md +++ b/files/en-us/web/api/window/index.md @@ -105,7 +105,7 @@ Note that properties which are objects (e.g., for overriding the prototype of bu - : An alias for {{domxref("window.scrollY")}}. - {{domxref("Window.parent")}} {{ReadOnlyInline}} - : Returns a reference to the parent of the current window or subframe. -- {{domxref("performance_property", "Window.performance")}} {{ReadOnlyInline}} +- {{domxref("Window.performance")}} {{ReadOnlyInline}} - : Returns a {{domxref("Performance")}} object, which includes the {{domxref("Performance.timing", "timing")}} and {{domxref("Performance.navigation", "navigation")}} attributes, each of which is an object providing [performance-related](/en-US/docs/Web/API/Performance_API/Navigation_timing) data. See also [Using Navigation Timing](/en-US/docs/Web/API/Performance_API/Navigation_timing) for additional information and examples. - {{domxref("Window.personalbar")}} {{ReadOnlyInline}} - : Returns the personalbar object. diff --git a/files/en-us/web/api/performance_property/index.md b/files/en-us/web/api/window/performance/index.md similarity index 85% rename from files/en-us/web/api/performance_property/index.md rename to files/en-us/web/api/window/performance/index.md index 0687011d3542374..164f19c805b5410 100644 --- a/files/en-us/web/api/performance_property/index.md +++ b/files/en-us/web/api/window/performance/index.md @@ -1,20 +1,20 @@ --- -title: performance global property +title: "Window: performance property" short-title: performance -slug: Web/API/performance_property -page-type: web-api-global-property +slug: Web/API/Window/performance +page-type: web-api-instance-property browser-compat: api.performance --- -{{APIRef("Performance API")}}{{AvailableInWorkers}} +{{APIRef("Performance API")}} -The global **`performance`** property returns a {{domxref("Performance")}} object, which can be used to gather performance information about the context it is called in (window or worker). +The **`performance`** property of the {{domxref("Window")}} interface returns a {{domxref("Performance")}} object, which can be used to gather performance information about the context it is called in window. Performance entries are per context. If you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. ## Value -A {{domxref("Performance")}} object offering access to performance and timing-related information for the context it is called on (window or worker). +A {{domxref("Performance")}} object offering access to performance and timing-related information for the context it is called on window. ## Performance API availability @@ -50,3 +50,7 @@ The following table provides an overview about the availability of the performan ## Browser compatibility {{Compat}} + +## See also + +- {{domxref("WorkerGlobalScope.performance")}} diff --git a/files/en-us/web/api/workerglobalscope/index.md b/files/en-us/web/api/workerglobalscope/index.md index 76ade939d03e1e8..fb59fce866b4a38 100644 --- a/files/en-us/web/api/workerglobalscope/index.md +++ b/files/en-us/web/api/workerglobalscope/index.md @@ -37,7 +37,7 @@ _This interface inherits properties from the {{domxref("EventTarget")}} interfac - : Returns the {{domxref("WorkerNavigator")}} associated with the worker. It is a specific navigator object, mostly a subset of the {{domxref("Navigator")}} for browsing scopes, but adapted to workers. - {{domxref("origin", "WorkerGlobalScope.origin")}} {{ReadOnlyInline}} - : Returns the global object's origin, serialized as a string. -- {{domxref("performance_property", "WorkerGlobalScope.performance")}} {{ReadOnlyInline}} +- {{domxref("WorkerGlobalScope.performance")}} {{ReadOnlyInline}} - : Returns the {{domxref("Performance")}} associated with the worker. It is a regular performance object, except that only a subset of its property and methods are available to workers. - {{domxref("scheduler_property", "WorkerGlobalScope.scheduler")}} {{ReadOnlyInline}} - : Returns the {{domxref("Scheduler")}} object associated with the current context. This is the entry point for using the [Prioritized Task Scheduling API](/en-US/docs/Web/API/Prioritized_Task_Scheduling_API). diff --git a/files/en-us/web/api/workerglobalscope/performance/index.md b/files/en-us/web/api/workerglobalscope/performance/index.md new file mode 100644 index 000000000000000..7071ff4b729cca0 --- /dev/null +++ b/files/en-us/web/api/workerglobalscope/performance/index.md @@ -0,0 +1,33 @@ +--- +title: "WorkerGlobalScope: performance property" +short-title: performance +slug: Web/API/WorkerGlobalScope/performance +page-type: web-api-instance-property +browser-compat: api.performance +--- + +{{APIRef("Performance API")}} + +The **`performance`** property of the {{domxref("WorkerGlobalScope")}} interface returns a {{domxref("Performance")}} object, which can be used to gather performance information about the context it is called in worker. + +Performance entries are per context. If you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. + +## Value + +A {{domxref("Performance")}} object offering access to performance and timing-related information for the context it is called on worker. + +## Performance API availability + +See the table which provides an overview about the availability of the performance APIs in window and worker contexts at {{domxref("Window.performance")}}. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("Window.performance")}} diff --git a/files/en-us/web/javascript/reference/global_objects/date/gettime/index.md b/files/en-us/web/javascript/reference/global_objects/date/gettime/index.md index 383f6727abb2af6..0b7a9a1362c8a9a 100644 --- a/files/en-us/web/javascript/reference/global_objects/date/gettime/index.md +++ b/files/en-us/web/javascript/reference/global_objects/date/gettime/index.md @@ -78,7 +78,7 @@ end = new Date(); console.log(`Operation took ${end.getTime() - start.getTime()} msec`); ``` -> **Note:** In browsers that support the {{domxref("performance_property", "Web Performance API", "", 1)}}'s high-resolution time feature, {{domxref("Performance.now()")}} can provide more reliable and precise measurements of elapsed time than {{jsxref("Date.now()")}}. +> **Note:** In browsers that support the {{domxref("Performance API", "", "", "nocode")}}'s high-resolution time feature, {{domxref("Performance.now()")}} can provide more reliable and precise measurements of elapsed time than {{jsxref("Date.now()")}}. ## Specifications diff --git a/files/en-us/web/javascript/reference/global_objects/date/index.md b/files/en-us/web/javascript/reference/global_objects/date/index.md index cd3b8512091e148..bea63d04cb8a3f9 100644 --- a/files/en-us/web/javascript/reference/global_objects/date/index.md +++ b/files/en-us/web/javascript/reference/global_objects/date/index.md @@ -409,7 +409,7 @@ function printElapsedTime(testFn) { const yourFunctionReturn = printElapsedTime(yourFunction); ``` -> **Note:** In browsers that support the {{domxref("performance_property", "Web Performance API", "", 1)}}'s high-resolution time feature, {{domxref("Performance.now()")}} can provide more reliable and precise measurements of elapsed time than {{jsxref("Date.now()")}}. +> **Note:** In browsers that support the {{domxref("Performance API", "", "", "nocode")}}'s high-resolution time feature, {{domxref("Performance.now()")}} can provide more reliable and precise measurements of elapsed time than {{jsxref("Date.now()")}}. ### Get the number of seconds since the ECMAScript Epoch diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 80e07c9cd1497a2..e0275264f93faea 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -1108,7 +1108,7 @@ "VisibilityStateEntry" ], "methods": [], - "properties": ["performance_property"], + "properties": ["Window.performance", "WorkerGlobalScope.performance"], "events": [] }, "Periodic Background Sync": { diff --git a/package.json b/package.json index aa3fe564fceb9a8..29e2c3b32e4d5dc 100644 --- a/package.json +++ b/package.json @@ -60,5 +60,6 @@ }, "devDependencies": { "jest": "^29.7.0" - } + }, + "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" }