[GitHub] [wicket] theigl opened a new pull request #449: WICKET-6824 Replace slow `String.format` with concatenation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] theigl opened a new pull request #449: WICKET-6824 Replace slow `String.format` with concatenation

GitBox

theigl opened a new pull request #449:
URL: https://github.com/apache/wicket/pull/449


   This PR replaces two frequently called usages of `String.format` with concatenation because it is orders of magnitudes faster.
   
   See https://issues.apache.org/jira/browse/WICKET-6824


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] asfgit closed pull request #449: WICKET-6824 Replace slow `String.format` with concatenation

GitBox

asfgit closed pull request #449:
URL: https://github.com/apache/wicket/pull/449


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] solomax commented on a change in pull request #449: WICKET-6824 Replace slow `String.format` with concatenation

GitBox
In reply to this post by GitBox

solomax commented on a change in pull request #449:
URL: https://github.com/apache/wicket/pull/449#discussion_r479840011



##########
File path: wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
##########
@@ -61,16 +61,16 @@
  public static final ResourceReference INDICATOR = new PackageResourceReference(
  AbstractDefaultAjaxBehavior.class, "indicator.gif");
 
- private static final String DYNAMIC_PARAMETER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String PRECONDITION_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String COMPLETE_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, textStatus){%s}";
- private static final String FAILURE_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, errorMessage, textStatus){%s}";
- private static final String SUCCESS_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, data, textStatus){%s}";
- private static final String AFTER_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String BEFORE_SEND_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, settings){%s}";
- private static final String BEFORE_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String INIT_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String DONE_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
+ private static final String DYNAMIC_PARAMETER_FUNCTION_TEMPLATE = "function(attrs)";

Review comment:
       Maybe there is no need in all these constants with same value?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] svenmeier commented on a change in pull request #449: WICKET-6824 Replace slow `String.format` with concatenation

GitBox
In reply to this post by GitBox

svenmeier commented on a change in pull request #449:
URL: https://github.com/apache/wicket/pull/449#discussion_r479950373



##########
File path: wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
##########
@@ -61,16 +61,16 @@
  public static final ResourceReference INDICATOR = new PackageResourceReference(
  AbstractDefaultAjaxBehavior.class, "indicator.gif");
 
- private static final String DYNAMIC_PARAMETER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String PRECONDITION_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String COMPLETE_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, textStatus){%s}";
- private static final String FAILURE_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, errorMessage, textStatus){%s}";
- private static final String SUCCESS_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, data, textStatus){%s}";
- private static final String AFTER_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String BEFORE_SEND_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, settings){%s}";
- private static final String BEFORE_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String INIT_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String DONE_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
+ private static final String DYNAMIC_PARAMETER_FUNCTION_TEMPLATE = "function(attrs)";

Review comment:
       IMHO these constants serve as a good documentation for the functions' actual parameters.
   
   And it will be hard to come up with good names of all used parameter combinations anyway :)
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] solomax commented on a change in pull request #449: WICKET-6824 Replace slow `String.format` with concatenation

GitBox
In reply to this post by GitBox

solomax commented on a change in pull request #449:
URL: https://github.com/apache/wicket/pull/449#discussion_r480152693



##########
File path: wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
##########
@@ -61,16 +61,16 @@
  public static final ResourceReference INDICATOR = new PackageResourceReference(
  AbstractDefaultAjaxBehavior.class, "indicator.gif");
 
- private static final String DYNAMIC_PARAMETER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String PRECONDITION_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String COMPLETE_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, textStatus){%s}";
- private static final String FAILURE_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, errorMessage, textStatus){%s}";
- private static final String SUCCESS_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, data, textStatus){%s}";
- private static final String AFTER_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String BEFORE_SEND_HANDLER_FUNCTION_TEMPLATE = "function(attrs, jqXHR, settings){%s}";
- private static final String BEFORE_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String INIT_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
- private static final String DONE_HANDLER_FUNCTION_TEMPLATE = "function(attrs){%s}";
+ private static final String DYNAMIC_PARAMETER_FUNCTION_TEMPLATE = "function(attrs)";

Review comment:
       make sense :)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[hidden email]