tree: 84b0977419701fdd7cc28478eee2c501c3a81963 [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. internals_profiler.cc
  25. internals_profiler.h
  26. internals_profiler.idl
  27. Key_interaction_state_machine.md
  28. largest_contentful_paint.cc
  29. largest_contentful_paint.h
  30. largest_contentful_paint.idl
  31. layout_shift.cc
  32. layout_shift.h
  33. layout_shift.idl
  34. layout_shift_attribution.cc
  35. layout_shift_attribution.h
  36. layout_shift_attribution.idl
  37. memory_info.cc
  38. memory_info.h
  39. memory_info.idl
  40. memory_info_test.cc
  41. not_restored_reason_details.cc
  42. not_restored_reason_details.h
  43. not_restored_reasons.cc
  44. not_restored_reasons.h
  45. not_restored_reasons.idl
  46. OWNERS
  47. performance.cc
  48. performance.h
  49. performance.idl
  50. performance_element_timing.cc
  51. performance_element_timing.h
  52. performance_element_timing.idl
  53. performance_entry.cc
  54. performance_entry.h
  55. performance_entry.idl
  56. performance_entry_filter_options.idl
  57. performance_entry_list.idl
  58. performance_entry_names.json5
  59. performance_entry_test.cc
  60. performance_event_timing.cc
  61. performance_event_timing.h
  62. performance_event_timing.idl
  63. performance_long_animation_frame_timing.cc
  64. performance_long_animation_frame_timing.h
  65. performance_long_animation_frame_timing.idl
  66. performance_long_task_timing.cc
  67. performance_long_task_timing.h
  68. performance_long_task_timing.idl
  69. performance_mark.cc
  70. performance_mark.h
  71. performance_mark.idl
  72. performance_mark_options.idl
  73. performance_mark_test.cc
  74. performance_measure.cc
  75. performance_measure.h
  76. performance_measure.idl
  77. performance_measure_options.idl
  78. performance_navigation.cc
  79. performance_navigation.h
  80. performance_navigation.idl
  81. performance_navigation_timing.cc
  82. performance_navigation_timing.h
  83. performance_navigation_timing.idl
  84. performance_navigation_timing_activation_start.cc
  85. performance_navigation_timing_activation_start.h
  86. performance_navigation_timing_activation_start.idl
  87. performance_navigation_timing_test.cc
  88. performance_observer.cc
  89. performance_observer.h
  90. performance_observer.idl
  91. performance_observer_callback_options.idl
  92. performance_observer_entry_list.cc
  93. performance_observer_entry_list.h
  94. performance_observer_entry_list.idl
  95. performance_observer_init.idl
  96. performance_observer_test.cc
  97. performance_paint_timing.cc
  98. performance_paint_timing.h
  99. performance_paint_timing.idl
  100. performance_resource_timing.cc
  101. performance_resource_timing.h
  102. performance_resource_timing.idl
  103. performance_resource_timing_test.cc
  104. performance_script_timing.cc
  105. performance_script_timing.h
  106. performance_script_timing.idl
  107. performance_server_timing.cc
  108. performance_server_timing.h
  109. performance_server_timing.idl
  110. performance_test.cc
  111. performance_timing.cc
  112. performance_timing.h
  113. performance_timing.idl
  114. performance_timing_for_reporting.cc
  115. performance_timing_for_reporting.h
  116. performance_user_timing.cc
  117. performance_user_timing.h
  118. Pointer_interaction_state_machine.md
  119. profiler.cc
  120. profiler.h
  121. profiler.idl
  122. profiler_frame.idl
  123. profiler_group.cc
  124. profiler_group.h
  125. profiler_group_test.cc
  126. profiler_init_options.idl
  127. profiler_sample.idl
  128. profiler_stack.idl
  129. profiler_trace.idl
  130. README.md
  131. render_blocking_metrics_reporter.cc
  132. render_blocking_metrics_reporter.h
  133. responsiveness_metrics.cc
  134. responsiveness_metrics.h
  135. soft_navigation_entry.cc
  136. soft_navigation_entry.h
  137. soft_navigation_entry.idl
  138. soft_navigation_heuristics.cc
  139. soft_navigation_heuristics.h
  140. soft_navigation_heuristics_test.cc
  141. task_attribution_timing.cc
  142. task_attribution_timing.h
  143. task_attribution_timing.idl
  144. third_party_script_detector.cc
  145. third_party_script_detector.h
  146. time_clamper.cc
  147. time_clamper.h
  148. time_clamper_test.cc
  149. visibility_state_entry.cc
  150. visibility_state_entry.h
  151. visibility_state_entry.idl
  152. window_performance.cc
  153. window_performance.h
  154. window_performance.idl
  155. window_performance_test.cc
  156. worker_global_scope_performance.cc
  157. worker_global_scope_performance.h
  158. worker_global_scope_performance.idl
  159. worker_performance.cc
  160. worker_performance.h
  161. 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.