Details
Description
All generated ids come from the UIViewRoot, and are generally of the form: "j_id52" where the number after the "j_id" prefix is an incrementing integer. Every single component tree, for every user, in every JSF application will use the same set of ids, which makes them good for interning. I recommend capping what numerical range we'll intern, since dynamically <ui:include>'d components can get ever increasing ids, when what's included continually switches. Both JSP and Facelets applications should benefit.
All we have to do is add the following code to D2DViewHandler.createView(FacesContext, String)'s inner class that's UIViewRoot sub-class, somewhere around line 221.
private static final int MAX_COUNT = 500;
private int count = 0;
public String createUniqueId() {
String uniqueId = super.createUniqueId();
if(++count < MAX_COUNT) {
uniqueId = uniqueId.intern();
}
return uniqueId;
}
All we have to do is add the following code to D2DViewHandler.createView(FacesContext, String)'s inner class that's UIViewRoot sub-class, somewhere around line 221.
private static final int MAX_COUNT = 500;
private int count = 0;
public String createUniqueId() {
String uniqueId = super.createUniqueId();
if(++count < MAX_COUNT) {
uniqueId = uniqueId.intern();
}
return uniqueId;
}
Issue Links
- blocks
-
ICE-3083 Memory performance/efficiency
- Open
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
committed to revision 17366