Remove Document-Policy header requirement #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Discussions with @acomminos lead me to believe that the Document-Policy header requirement is superfluous and we can instead launch the profiler lazily when the first
new Profiler
is created.Currently, the requirement to enable js-profiling with the
Document-Policy
header forces authors to decide whether JS profiling will be available on the server side at page load time, which has several downsides:The header was initially introduced because of a mistaken belief that launching the profiler before pageload would result in a faster profiler startup time because the JS heap would be empty to begin with, and profiling metadata collection could be amortized as functions were parsed and added to the heap. This is true for some initial page loads, but if Chromium has a code cache for a page (i.e. if it's not a first-load), that cache will be loaded into the heap before the profiler begins, which is just as much work as if the profiler were started later, so this benefit is questionable. The cost of this initial load was missed at design time because it happens very early in page load (before any JS runs!) and so was difficult to measure.
Preview | Diff