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

Omit the cache lookup in AbstractMessageInterpolator for the simple text messages

Description

In case of simple custom string message defined by the user we should not cache it and just return an unescaped version of it.

An example of such message:

1 2 3 4 public class Person { @NotNull(message = "name should not be `null`") String name; }

Benchmarks for such a change:

1 2 3 4 5 6 7 8 9 6.0.8: Benchmark                                                Mode  Cnt     Score     Error   Units SimpleValidation.testSimpleBeanValidation               thrpt   20  1020.530 ±  29.516  ops/ms SimpleValidation.testSimpleBeanValidationCustomMessage  thrpt   20  1140.450 ± 111.788  ops/ms changes: Benchmark                                                Mode  Cnt     Score    Error   Units SimpleValidation.testSimpleBeanValidation               thrpt   20  1087.163 ± 30.949  ops/ms SimpleValidation.testSimpleBeanValidationCustomMessage  thrpt   20  1339.740 ± 26.829  ops/ms

Environment

None

Status

Assignee

Marko Bekhta

Reporter

Marko Bekhta

Labels

None

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