You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/09/19 08:09:59 UTC

[Bug 53895] New: Performance solution for ImplicitObjectELResolver

https://issues.apache.org/bugzilla/show_bug.cgi?id=53895

          Priority: P2
            Bug ID: 53895
          Assignee: dev@tomcat.apache.org
           Summary: Performance solution for ImplicitObjectELResolver
          Severity: normal
    Classification: Unclassified
          Reporter: xshao@ebay.com
          Hardware: PC
            Status: NEW
           Version: trunk
         Component: Jasper
           Product: Tomcat 7

Created attachment 29391
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29391&action=edit
New ImplicitObjectELResolverImpl

ImplicitObjectELResolver uses Arrays.binarySearch to check scope name.
 It isn't very efficient.

It can be improved by using a map to hold the scope to scopeIndex.
 Such as,

 private static final Map<String, Integer> scopeMap = new HashMap<String,
Integer>();

 static {
 for (int i = 0; i < SCOPE_NAMES.length; i++) { scopeMap.put(SCOPE_NAMES[i],
i); }
 }

More detail please check out the attachment
"ImplicitObjectELResolverImpl.java".

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53895] Performance solution for ImplicitObjectELResolver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53895

Sheldon Shao <xs...@ebay.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53895] Performance solution for ImplicitObjectELResolver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53895

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
There are multiple concerns with this proposal.

1. Patches should be provided in diff -u format and not include formatting
changes. It took time to get the proposed new class into a form where a true
diff (no formatting changes) was available to review.

2. A few hundred milliseconds difference over 10 million look-ups is not very
much. I'd be prepared to make the change in this case as the new code is no
more complex than the old.

3. Testing locally I only see a few 10s of ms difference in the provided test
case. That makes applying the patch a lot harder to justify.

4. Experimenting with different scopes (rather than pageContext) shows the new
version is slower, not faster, for some. Any future proposal (and I am not sure
it is worth pursuing)  needs to include a testcase that examines all scopes
rather than one that appears to show the most favourable results.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53895] Performance solution for ImplicitObjectELResolver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53895

--- Comment #4 from Christopher Schultz <ch...@christopherschultz.net> ---
It's worth noting that the proposed solution requires more heap space than the
old solution. If this change is at the compiled-page level, it might not be a
big deal. If a new HashMap gets created for every invocation of the JSP then it
might be a performance problem under load due to the additional garbage
generated.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53895] Performance solution for ImplicitObjectELResolver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53895

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Created attachment 29514
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29514&action=edit
Diff -u format of proposed change

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53895] Performance solution for ImplicitObjectELResolver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53895

--- Comment #1 from Sheldon Shao <xs...@ebay.com> ---
Created attachment 29392
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29392&action=edit
Comparison test case

Sample test result:

New ImplicitObjectELResolver:578
Old ImplicitObjectELResolver:795
New ImplicitObjectELResolver:624
Old ImplicitObjectELResolver:889
New ImplicitObjectELResolver:515
Old ImplicitObjectELResolver:999
New ImplicitObjectELResolver:624
Old ImplicitObjectELResolver:1030
New ImplicitObjectELResolver:546
Old ImplicitObjectELResolver:1108
New ImplicitObjectELResolver:546
Old ImplicitObjectELResolver:982
New ImplicitObjectELResolver:640
Old ImplicitObjectELResolver:1060

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org