Bug 258014 - Navigation Timing L2 often returns negative timing values for documents served from memory cache
Summary: Navigation Timing L2 often returns negative timing values for documents serve...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-13 04:03 PDT by Andy Davies
Modified: 2023-06-20 04:04 PDT (History)
4 users (show)

See Also:


Attachments
Screenshot showing negative NT2 values (246.94 KB, image/png)
2023-06-13 04:03 PDT, Andy Davies
no flags Details
NT1 calculated values (225.33 KB, image/png)
2023-06-13 04:04 PDT, Andy Davies
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Davies 2023-06-13 04:03:10 PDT
Created attachment 466677 [details]
Screenshot showing negative NT2 values

Description:

Navigation Level 2 API returns negative values for several metrics when the document is served from memory cache.

Behaviour doesn't happen 100% of the time but seems common enough to make it easy to reproduce.

Behaviours hasn't been reproduced when document comes from the network, or the disk cache.

When there are negative values in NT2, the values calculated via NT1 appear to be reasonable

Negative values appear to be constrained to: 


Reproduction:

- Open speedcurve.com
- Navigate between a couple of pages until the Inspector shows the document has been loaded from memory cache
- Query the NT2 API i.e. performance.getEntriesByType('navigation')[0]; 
- Observe negative values (steps 2 & 3 might need repeating a few times)


Notes:

Tested on iPhone with iOS 16.5, Safari 16.5 (17615.2.9.11.6, 17615) and STP 171 (Safari 16.4, WebKit 17616.1.15) running on Intel Mac
Comment 1 Andy Davies 2023-06-13 04:04:01 PDT
Created attachment 466678 [details]
NT1 calculated values
Comment 2 Radar WebKit Bug Importer 2023-06-20 04:04:16 PDT
<rdar://problem/111032230>