Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(lantern): use securityOrigin on record #5071

Merged
merged 1 commit into from
Apr 30, 2018

Conversation

patrickhulce
Copy link
Collaborator

@patrickhulce patrickhulce commented Apr 30, 2018

found a good bug while working on #5070 that's relatively independent

basically if you try to call network analysis before you create a network node from the network record, all the origins will be undefined and so the additionalRttByOrigin and serverResponseTimeByOrigin are totally useless for the future cached runs that do properly create a network node from the network record. We originally did this because calling new URL() to get the origin was super expensive and these are somewhat hot paths, while the function call + getter is a bit more expensive, it's still not nearly as bad as new URL. Seems OK until it crops up as a bottleneck

this PR reverts the .origin dance we do on network records and just uses .securityOrigin() on the record, if it becomes a big bottleneck again we can further optimize

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM2

@brendankenny
Copy link
Member

brendankenny commented Apr 30, 2018

Can you add a description of the bug to the PR for future git blaming? :)

@patrickhulce patrickhulce merged commit 756ee63 into master Apr 30, 2018
@brendankenny brendankenny deleted the fix_simulator_origin branch April 30, 2018 22:11
kdzwinel pushed a commit to kdzwinel/lighthouse that referenced this pull request Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants