optimize array instrumentation
------------------------------

                 Key: CDV-788
                 URL: https://jira.terracotta.org/jira//browse/CDV-788
             Project: Community Development
          Issue Type: New Feature
          Components: Byte Code Transform
            Reporter: Tim Eck
            Assignee: Issue Review Board


inspiration: http://forums.terracotta.org/forums/posts/list/1150.page

The basic idea of this feature request to make sure code that uses arrays 
doesn't pay any extra instrumentation overhead. Array instrumentation is not 
particularly fast since we have to check a map to figure if a given array 
reference is managed or not. Given that arrays naturally lend themselves to 
tight code loops, the cost of the check really adds up. Code that works with 
multi-dimensional arrays get taxed even more. 

A first optimization would be do to static analysis on methods that contain 
array instructions to prove that given references on the stack cannot possibly 
be managed (thus all TC instrumentation need not be added). An example is array 
reference that is new'd within the scope of the method and is neither assigned 
to any fields and/or passed to any methods. In this case there is no 
opportunity for it to become shared.

Another possibility is to discover loops and determine if the "isManaged" check 
can be done once instead of every time through the loop.

This type of analysis is challenging and tricky for sure, but it is possible

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to