There are still a few places in the "project production" java files where precompiled Regexps are not used.
For example, some calls to the String#replaceAll and String#replaceFirst methods.
Trino code examples:
name.replaceAll("[^A-Za-z0-9_$]", "_");
metadataLocation.replaceFirst("/metadata/[^/]*$", "");
We can avoid that by explicitly using a Pattern object.
More info:
https://stackoverflow.com/a/6262439
The performance increase will probably be minimal, but... it's still something ;)