We're updating the issue view to help you get more done. 

Cache type variable index for performance reasons

Description

While doing some profiling on cascaded and collection validation a `TypeVariables#getTypeParameterIndex()` showed pretty high and it looks that we can omit calculating it at runtime. After the changes here are some benchmark results:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 current master: # Run complete. Total time: 00:01:52 Benchmark Mode Cnt Score Error Units CascadedValidation.testCascadedValidation thrpt 20 160.152 ± 11.923 ops/ms CascadedWithLotsOfItemsAndMoreConstraintsValidation.testCascadedValidationWithLotsOfItems thrpt 20 471.770 ± 8.797 ops/s CascadedWithLotsOfItemsValidation.testCascadedValidationWithLotsOfItems thrpt 20 633.382 ± 11.182 ops/s with changes # Run complete. Total time: 00:01:50 Benchmark Mode Cnt Score Error Units CascadedValidation.testCascadedValidation thrpt 20 170.439 ± 15.699 ops/ms CascadedWithLotsOfItemsAndMoreConstraintsValidation.testCascadedValidationWithLotsOfItems thrpt 20 471.262 ± 20.874 ops/s CascadedWithLotsOfItemsValidation.testCascadedValidationWithLotsOfItems thrpt 20 703.661 ± 39.131 ops/s

Environment

None

Status

Assignee

Marko Bekhta

Reporter

Marko Bekhta

Labels

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Minor