When I wrap the values into value objects (with @Valid), the validation runs very fast (although it supposedly does the same: recurse into values with @Valid and validate with @NotNull and @Min ):
0 items, avg. validation time: 49.520402 ms 1 items, avg. validation time: 50.609528 ms 2 items, avg. validation time: 50.88673 ms 5 items, avg. validation time: 50.236684 ms 10 items, avg. validation time: 49.789304 ms 20 items, avg. validation time: 48.713483 ms 50 items, avg. validation time: 50.069192 ms 100 items, avg. validation time: 50.027649 ms 200 items, avg. validation time: 49.037075 ms 500 items, avg. validation time: 50.690123 ms 1000 items, avg. validation time: 50.057061 ms 2500 items, avg. validation time: 49.99966 ms 5000 items, avg. validation time: 48.518808 ms 7500 items, avg. validation time: 50.0492 ms 10000 items, avg. validation time: 50.01165 ms 20000 items, avg. validation time: 48.984054 ms 30000 items, avg. validation time: 51.152249 ms 40000 items, avg. validation time: 50.320894 ms 50000 items, avg. validation time: 50.039272 ms |