You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Marc Nuri (JIRA)" <ji...@apache.org> on 2014/06/02 16:17:01 UTC

[jira] [Created] (WICKET-5605) Store browser capabilities in local variables in wicket-event-jquery.js

Marc Nuri created WICKET-5605:
---------------------------------

             Summary: Store browser capabilities in local variables in wicket-event-jquery.js
                 Key: WICKET-5605
                 URL: https://issues.apache.org/jira/browse/WICKET-5605
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
            Reporter: Marc Nuri
            Priority: Minor


Methods in Wicket.Browser js class (such as isIE, isKHTML, isSafari... ) perform a regular expression test in windows.navigator.userAgent variable each time they are called.

It would improve performance if these methods stored their result in a variable for future checks.

As described in this InMethodGrid issue (https://github.com/wicketstuff/core/issues/308#issuecomment-44816191), recursive calls to these methods in a Windows environment with Chrome version 35 are killing the CPU.

The solution is as simple as caching the result of the regexp test the first time the method is called and return the variable value in subsequent calls.



--
This message was sent by Atlassian JIRA
(v6.2#6252)