Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Unified Diff: components/variations/variations_seed_processor.cc

Issue 947493002: Optimize variation field trial evaluation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/variations/variations_seed_processor.cc
diff --git a/components/variations/variations_seed_processor.cc b/components/variations/variations_seed_processor.cc
index 378f54491c86e301afba2f15871f3ad595effa85..9d7300de5f1ee46fc47c60f573bfa103599f1837 100644
--- a/components/variations/variations_seed_processor.cc
+++ b/components/variations/variations_seed_processor.cc
@@ -144,7 +144,11 @@ void VariationsSeedProcessor::CreateTrialFromStudy(
base::FieldTrial::RandomizationType randomization_type =
base::FieldTrial::SESSION_RANDOMIZED;
if (study.has_consistency() &&
- study.consistency() == Study_Consistency_PERMANENT) {
+ study.consistency() == Study_Consistency_PERMANENT &&
+ // If all assignments are to a single group, no need to enable one time
+ // randomization (which is more expensive to compute), since the result
+ // will be the same.
+ !processed_study.all_assignments_to_one_group()) {
randomization_type = base::FieldTrial::ONE_TIME_RANDOMIZED;
if (study.has_randomization_seed())
randomization_seed = study.randomization_seed();
« no previous file with comments | « components/variations/processed_study.cc ('k') | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698