tree: a1b05cb5b066cbadc30ac59bf61db51374ed3ede [path history] [tgz]
  1. measure_memory/
  2. animation_frame_timing_info.cc
  3. animation_frame_timing_info.h
  4. back_forward_cache_restoration.cc
  5. back_forward_cache_restoration.h
  6. back_forward_cache_restoration.idl
  7. background_tracing_helper.cc
  8. background_tracing_helper.h
  9. background_tracing_helper_test.cc
  10. build.gni
  11. DEPS
  12. DIR_METADATA
  13. dom_high_res_time_stamp.idl
  14. dom_window_performance.cc
  15. dom_window_performance.h
  16. epoch_time_stamp.h
  17. epoch_time_stamp.idl
  18. event_counts.cc
  19. event_counts.h
  20. event_counts.idl
  21. event_timing.cc
  22. event_timing.h
  23. First_input_state_machine.md
  24. global_performance.cc
  25. global_performance.h
  26. interaction_contentful_paint.cc
  27. interaction_contentful_paint.h
  28. interaction_contentful_paint.idl
  29. interaction_effects_monitor.cc
  30. interaction_effects_monitor.h
  31. interaction_effects_monitor_test.cc
  32. internals_profiler.cc
  33. internals_profiler.h
  34. internals_profiler.idl
  35. Key_interaction_state_machine.md
  36. largest_contentful_paint.cc
  37. largest_contentful_paint.h
  38. largest_contentful_paint.idl
  39. layout_shift.cc
  40. layout_shift.h
  41. layout_shift.idl
  42. layout_shift_attribution.cc
  43. layout_shift_attribution.h
  44. layout_shift_attribution.idl
  45. memory_info.cc
  46. memory_info.h
  47. memory_info.idl
  48. memory_info_test.cc
  49. navigation_id_generator.cc
  50. navigation_id_generator.h
  51. navigation_id_generator_test.cc
  52. not_restored_reason_details.cc
  53. not_restored_reason_details.h
  54. not_restored_reasons.cc
  55. not_restored_reasons.h
  56. not_restored_reasons.idl
  57. OWNERS
  58. paint_timing_mixin.idl
  59. performance.cc
  60. performance.h
  61. performance.idl
  62. performance_container_timing.cc
  63. performance_container_timing.h
  64. performance_container_timing.idl
  65. performance_element_timing.cc
  66. performance_element_timing.h
  67. performance_element_timing.idl
  68. performance_entry.cc
  69. performance_entry.h
  70. performance_entry.idl
  71. performance_entry_list.idl
  72. performance_entry_names.json5
  73. performance_event_timing.cc
  74. performance_event_timing.h
  75. performance_event_timing.idl
  76. performance_long_animation_frame_timing.cc
  77. performance_long_animation_frame_timing.h
  78. performance_long_animation_frame_timing.idl
  79. performance_long_task_timing.cc
  80. performance_long_task_timing.h
  81. performance_long_task_timing.idl
  82. performance_mark.cc
  83. performance_mark.h
  84. performance_mark.idl
  85. performance_mark_options.idl
  86. performance_mark_test.cc
  87. performance_measure.cc
  88. performance_measure.h
  89. performance_measure.idl
  90. performance_measure_options.idl
  91. performance_navigation.cc
  92. performance_navigation.h
  93. performance_navigation.idl
  94. performance_navigation_timing.cc
  95. performance_navigation_timing.h
  96. performance_navigation_timing.idl
  97. performance_navigation_timing_activation_start.cc
  98. performance_navigation_timing_activation_start.h
  99. performance_navigation_timing_activation_start.idl
  100. performance_navigation_timing_test.cc
  101. performance_observer.cc
  102. performance_observer.h
  103. performance_observer.idl
  104. performance_observer_callback_options.idl
  105. performance_observer_entry_list.cc
  106. performance_observer_entry_list.h
  107. performance_observer_entry_list.idl
  108. performance_observer_init.idl
  109. performance_observer_test.cc
  110. performance_paint_timing.cc
  111. performance_paint_timing.h
  112. performance_paint_timing.idl
  113. performance_resource_timing.cc
  114. performance_resource_timing.h
  115. performance_resource_timing.idl
  116. performance_resource_timing_test.cc
  117. performance_script_timing.cc
  118. performance_script_timing.h
  119. performance_script_timing.idl
  120. performance_server_timing.cc
  121. performance_server_timing.h
  122. performance_server_timing.idl
  123. performance_test.cc
  124. performance_timing.cc
  125. performance_timing.h
  126. performance_timing.idl
  127. performance_timing_confidence.cc
  128. performance_timing_confidence.h
  129. performance_timing_confidence.idl
  130. performance_timing_for_reporting.cc
  131. performance_timing_for_reporting.h
  132. performance_user_timing.cc
  133. performance_user_timing.h
  134. Pointer_interaction_state_machine.md
  135. profiler.cc
  136. profiler.h
  137. profiler.idl
  138. profiler_frame.idl
  139. profiler_group.cc
  140. profiler_group.h
  141. profiler_group_test.cc
  142. profiler_init_options.idl
  143. profiler_sample.idl
  144. profiler_stack.idl
  145. profiler_trace.idl
  146. README.md
  147. render_blocking_metrics_reporter.cc
  148. render_blocking_metrics_reporter.h
  149. responsiveness_metrics.cc
  150. responsiveness_metrics.h
  151. soft_navigation_context.cc
  152. soft_navigation_context.h
  153. soft_navigation_entry.cc
  154. soft_navigation_entry.h
  155. soft_navigation_entry.idl
  156. soft_navigation_heuristics.cc
  157. soft_navigation_heuristics.h
  158. soft_navigation_heuristics_test.cc
  159. soft_navigation_heuristics_test_util.cc
  160. soft_navigation_heuristics_test_util.h
  161. soft_navigation_paint_attribution_tracker.cc
  162. soft_navigation_paint_attribution_tracker.h
  163. soft_navigation_paint_attribution_tracker_test.cc
  164. task_attribution_timing.cc
  165. task_attribution_timing.h
  166. task_attribution_timing.idl
  167. third_party_script_detector.cc
  168. third_party_script_detector.h
  169. time_clamper.cc
  170. time_clamper.h
  171. time_clamper_test.cc
  172. timing_utils.cc
  173. timing_utils.h
  174. visibility_state_entry.cc
  175. visibility_state_entry.h
  176. visibility_state_entry.idl
  177. window_or_worker_global_scope_performance.idl
  178. window_performance.cc
  179. window_performance.h
  180. window_performance_test.cc
  181. worker_global_scope_performance.cc
  182. worker_global_scope_performance.h
  183. worker_performance.cc
  184. worker_performance.h
  185. worker_performance_test.cc
third_party/blink/renderer/core/timing/README.md

renderer/core/timing

Live version

The renderer/core/timing directory contains files related to various web performance APIs.

High Resolution Time

The HR-Time specification introduces the Performance interface, which exposes a high resolution monotonic clock via performance.now() and enables comparing timestamps across various contexts via performance.timeOrigin. This interface is exposed on both Windows and Workers and implemented on the Performance file, with window and worker specific code on WindowPerformance and (WorkerPerformance)(./worker_performance.h), respectively. The Performance interface is tied to its DOM via DOMWindowPerformance and WorkerGlobalScopePerformance.

Any new high resolution timestamps exposed through the web need to be set to the correct resolution to prevent privacy or security issues, and hence should go through the MonotonicTimeTo* methods in Performance, which will delegate the rounding details to the TimeClamper.

Performance Timeline

The Performance-Timeline specification enables exposing additional performance measurements via two methods: directly to the Performance, which can be polled via getter methods, or to a PerformanceObserver, which runs a callback upon receiving new entries. The latter interface is implemented in PerformanceObserver, and is the recommended way to query entries. A single nugget of performance information is encapsulated in a PerformanceEntry, which is the base interface. The type of the PerformanceEntry is codified in its entryType attribute. Newer types of performance entries may not support polling queries via the Performance object, whereas all must support callback queries via PerformanceObserver. This information is the availableFromTimeline bit in the registry. This registry also contains some additional useful information that is entry-type specific. Note that all of the interfaces listed in that table have corresponding files in this folder. While the objects exposing performance measurements via JS are concentrated in this folder, many of the computations are located in other folders. For instance, the Resource-Timing specification measures timing on fetches, and that timing needs to occur at the specific locations in code where the fetching occurs and then plumbed all the way to this folder.

First Input Timing

The PerformanceEventTiming interface provides timing information about the latency of the first discrete user interaction, specifically one of keydown, mousedown, click, a pointerdown followed by a pointerup. (Pointer down may be the start of scrolling, which is not tracked.) This is a subset of the EventTiming API, and provides key metrics to help measure and optimize the first impression on responsiveness of web users. FirstInputStateMachine visualizes the state machine logic of how the first input event timing entry got dispatched from a pipeline of performance event entries.

Event Timing - Interactions

The PerformanceEventTiming interface exposes timing information for each non-continuous event(fullList). Certain events can be further grouped up as interactions by assigning the same non-trivial interactionId. Others will have interactionId with value 0. The purpose of defining an interaction is to group events that fire during the same logical user gesture, so further analysis like INP can be done to better reflect the page responsiveness on user interactions.

PointerInteractionStateMachine visualizes the state machine logic of how the pointer related events (pointerdown, pointerup, pointercancel, click) get grouped up as a single interaction and get dispatched from the event timing pipeline.

KeyInteractionStateMachine visualizes the state machine logic of how the keyboard related events (keydown, input, keyup) get grouped up as a single interaction and get dispatched from the event timing pipeline.

Performance.mark — mark_feature_usage convention

The convention mark_feature_usage marks the usage of a user feature which may impact performance so that tooling and analytics can take it into account. This requires the following steps:

  1. Add a feature id to web_feature.mojom. It's recommended where applicable to prefix the feature name with kUserFeature..., indicating that this feature tracks a user defined feature. For an example, see the entry corresponding to kUserFeatureNgOptimizedImage.

  2. Allow-list the feature added to be used with UKM-based UseCounter, by making an entry in UseCounterMetricsRecorder::GetAllowedUkmFeatures().

  3. Add an entry to the map in PerformanceMark::GetUseCounterMapping() tying the user defined feature name (NgOptimizedImage in our example) to the UKM feature.

  4. Instrument user framework/application code with performance.mark('mark_feature_usage', as described in the User Timing Level 3 specification.