Open Bug 2007375 Opened 2 months ago Updated 2 months ago

Can we emulate the possibly-reduced delay from the network and the off-thread compilation for cached scripts?

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

People

(Reporter: arai, Unassigned)

References

(Blocks 1 open bug)

Details

bug 2004064 and bug 2007053 will address some cases where we execute the cached scripts too early,
which reduces the chances of performing layout/paint tasks, which results in regressing the fcp/FVC etc,
but there are some more cases that may need more delay.

One option is to emulate the original delay, or something similar, by making the script ready only after a timer dispatch.
If a script took 100ms to receive and 100ms to off-thread compile in the first run,
making the cached script available only after 200ms timer may achieve the same effect, and that can give other layout/paint tasks
sufficient time to make the visual update happening sooner.

Of course, just applying the same amount of delay to all cases will ruin the performance improvements from the cache,
so we could for example apply somewhat reduced amount of delay, so that the optimization still applies, but it won't block FCP.

Also, for the case where the compilation had been happening on main thread, only the network delay had been giving the time to other tasks,
(not actually accurate, given that off-thread tasks and other network activity still have more time),
and the required amount of the artificial delay may be different.

You need to log in before you can comment on or make changes to this bug.