diff --git a/benchmarks/form_benchmarks/form_validate/benchmark.py b/benchmarks/form_benchmarks/form_validate/benchmark.py index 03cf029667..6916b8c622 100644 --- a/benchmarks/form_benchmarks/form_validate/benchmark.py +++ b/benchmarks/form_benchmarks/form_validate/benchmark.py @@ -24,3 +24,15 @@ def time_form_validate(self): def time_form_invalid(self): self.invalid_form.is_valid() + + +class MultipleChoiceFieldValidate: + def setup(self): + bench_setup() + self.field = forms.MultipleChoiceField( + choices=[(str(i), str(i)) for i in range(5)] + ) + self.values = [str(i % 5) for i in range(1_000)] + + def time_validate_with_duplicate_values(self): + self.field.validate(self.values)