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
Mark Collette
created issue -
Mark Collette
made changes -
Field | Original Value | New Value |
---|---|---|
Security | Private [ 10001 ] | |
Assignee | Deryk Sinotte [ deryk.sinotte ] |
Deryk Sinotte
made changes -
Assignee | Deryk Sinotte [ deryk.sinotte ] | Arturo Zambrano [ artzambrano ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #17367 | Tue Aug 19 15:07:29 MDT 2008 | art.zambrano | |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java
|
Arturo Zambrano
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Summary | Intern generated ids | Memory: Intern generated ids |
Fix Version/s | 1.7.2 [ 10130 ] | |
Security | Private [ 10001 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7.2RC1 [ 10140 ] | |
Fix Version/s | 1.7.2 [ 10130 ] |
Ken Fyten
made changes -
Fix Version/s | 1.8DR#1 [ 10141 ] | |
Fix Version/s | 1.7.2RC1 [ 10140 ] |
Ken Fyten
made changes -
Fix Version/s | 1.8 [ 10161 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee | Arturo Zambrano [ artzambrano ] |
committed to revision 17366