PA: Parameterize minimum prepared contexts per bidder thread
This will help reduce wasted contexts until we implement a better heuristic for the number of contexts. Bug: 378135925 Change-Id: I0a4e410582117a1063acebfb52b768a565191f1e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6163726 Reviewed-by: Russ Hamilton <behamilton@google.com> Commit-Queue: Abigail Katcoff <abigailkatcoff@chromium.org> Cr-Commit-Position: refs/heads/main@{#1404918}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
1bc9714575
commit
a133621128
content/services/auction_worklet
@ -291,9 +291,10 @@ size_t CalculateNumberOfContextsToPreparePerThread(
|
||||
size_t threads) {
|
||||
return fmin(
|
||||
features::kFledgeMaxBidderContextsPerThreadInAdvance.Get(),
|
||||
fmax(1, (max_expected_required_contexts *
|
||||
features::kFledgeBidderContextsMultiplier.Get()) /
|
||||
(threads * features::kFledgeBidderContextsDivisor.Get())));
|
||||
fmax(features::kFledgeMinBidderContextsPerThreadInAdvance.Get(),
|
||||
(max_expected_required_contexts *
|
||||
features::kFledgeBidderContextsMultiplier.Get()) /
|
||||
(threads * features::kFledgeBidderContextsDivisor.Get())));
|
||||
}
|
||||
|
||||
// Check if trusted bidding signals, if any, are same-origin or cross-origin.
|
||||
|
@ -9373,7 +9373,8 @@ TEST_P(BidderWorkletMultiThreadingTest, CreatesCorrectNumberOfPremadeContexts) {
|
||||
features::kFledgePrepareBidderContextsInAdvance,
|
||||
{{"BidderContextsDivisor", "2"},
|
||||
{"BidderContextsMultiplier", "1"},
|
||||
{"MaxBidderContextsPerThread", "4"}});
|
||||
{"MaxBidderContextsPerThread", "4"},
|
||||
{"MinBidderContextsPerThread", "1"}});
|
||||
interest_group_trusted_bidding_signals_url_ = GURL("https://signals.test/");
|
||||
const GURL kFullSignalsUrl(
|
||||
"https://signals.test/?hostname=top.window.test&interestGroupNames=Fred");
|
||||
|
@ -46,6 +46,11 @@ BASE_FEATURE_PARAM(int,
|
||||
&kFledgePrepareBidderContextsInAdvance,
|
||||
"MaxBidderContextsPerThread",
|
||||
10);
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kFledgeMinBidderContextsPerThreadInAdvance,
|
||||
&kFledgePrepareBidderContextsInAdvance,
|
||||
"MinBidderContextsPerThread",
|
||||
1);
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kFledgeBidderContextsDivisor,
|
||||
&kFledgePrepareBidderContextsInAdvance,
|
||||
|
@ -40,6 +40,9 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kFledgePrepareBidderContextsInAdvance);
|
||||
CONTENT_EXPORT BASE_DECLARE_FEATURE_PARAM(
|
||||
int,
|
||||
kFledgeMaxBidderContextsPerThreadInAdvance);
|
||||
CONTENT_EXPORT BASE_DECLARE_FEATURE_PARAM(
|
||||
int,
|
||||
kFledgeMinBidderContextsPerThreadInAdvance);
|
||||
CONTENT_EXPORT BASE_DECLARE_FEATURE_PARAM(int, kFledgeBidderContextsDivisor);
|
||||
CONTENT_EXPORT BASE_DECLARE_FEATURE_PARAM(int, kFledgeBidderContextsMultiplier);
|
||||
|
||||
|
Reference in New Issue
Block a user