[ https://issues.apache.org/jira/browse/WICKET-6952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17485589#comment-17485589 ]
ASF GitHub Bot commented on WICKET-6952: ---------------------------------------- martin-g commented on a change in pull request #497: URL: https://github.com/apache/wicket/pull/497#discussion_r797322895 ########## File path: wicket-util/src/main/java/org/apache/wicket/util/lang/Args.java ########## @@ -66,6 +66,26 @@ return argument; } + /** + * Checks argument is not empty (not null and has a non-whitespace character) + * + * @param argument + * the argument to check for emptiness + * @param name + * the name to use in the error message + * @return The {@code argument} parameter if not empty + * @throws IllegalArgumentException + * when the passed {@code argument} is empty + */ Review comment: `This method overloads {@link #isEmpty(CharSequence)} for performance reasons.` is enough. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@wicket.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Performance improvements for Strings.isEmpty > -------------------------------------------- > > Key: WICKET-6952 > URL: https://issues.apache.org/jira/browse/WICKET-6952 > Project: Wicket > Issue Type: Improvement > Components: wicket-core > Affects Versions: 9.7.0 > Reporter: Thomas Heigl > Assignee: Thomas Heigl > Priority: Minor > > {{Strings.isEmpty}} is one of the most called methods in our application and > consistently shows up as hot in our production profiler. > Two simple performance optimizations can be tried: > - Overload the method with a {{String}} parameter, to help the JIT compiler > with it's decision to inline the method > - Avoid calling {{String.trim}} if the first character isn't whitespace > See https://github.com/apache/wicket/pull/497. -- This message was sent by Atlassian Jira (v8.20.1#820001)