-
Notifications
You must be signed in to change notification settings - Fork 247
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
Options for Reusing FLEDGE Worklet Contexts #304
Comments
Thank you Steven, this seems like an excellent suggestion. I agree that the " |
I think this optimization has a lot of potential. The time required to set up a new JavaScript context can actually be significantly more than the time required to execute a simple JavaScript function. This optimization makes worklet execution closer to how browser renderer processes execute JavaScript, where one context is used for all code execution, which is probably a good thing as it allows JavaScript engine authors to focus on just one use case. A few comments:
What do you think of this proposal: If many folks think this should be the default FLEDGE behavior, we can also eschew |
I have posted another option on for context reuse in issue #310 which proposes to harden the JavaScript environment so Chrome could reuse worklet contexts. |
FYI #339 |
I believe this support was added via the group-by-origin option. |
One of the bigger contributions to latency for generateBid arises from requiring a fresh JS context for each invocation. (Some efforts to measure suggest roughly 1ms per call on a modern desktop computer.) #162 discusses the possibility of generateBid being passed multiple interest groups (joined from the same advertiser site) in order to support some single-site cross-IG targeting and bidding options. Note that today advertisers frequently have many distinct remarketing lists, which may translate to many FLEDGE IGs. Users may belong to more than 1000 remarketing lists, but typically have visited no more than tens of distinct advertiser domains.
This issue is to propose that IGs joined from the same origin could reuse the same JS context for individual calls to generateBid as well as individual calls to scoreAd, as a browser optimization. This potentially reduces the number of contexts per runAdAuction call by more than 10-fold, for a significant improvement to
runAdAuction
latency. This could be implemented without an API change.This proposal is potentially susceptible to the same cross-site privacy leak described in this comment: even if all of the
joinAdInterestGroup
events for the IG occur on the same site, there is still potential cross-site information leaking whenleaveAdInterestGroup
is called from other sites. This issue can be resolved relatively easily by disabling the optimization ifleaveAdInterestGroup
is called from a different site for any of thejoinAdInterestGroup
site's interest groups.Similarly, concerns about #162 could be resolved in a similar way.
The text was updated successfully, but these errors were encountered: