DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=41044>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41044 ------- Additional Comments From [EMAIL PROTECTED] 2006-12-08 13:14 ------- (In reply to comment #6) I think Richard's approach is OK for read-only properties. Andreas, why is your valueCache not also a map on the value? I am not sure that your approach is worth the trouble. An EnumProperty and an Attribute object contain only a name and a value, and two more strings in the latter case. It is quite efficient to use that as a key, and creating an object for lookup is not very costly in view of the efficient hash lookup you achieve. First doing a lookup on name and then on value may cost more than it saves. Of course a map in which the key and the value are always identical seems strange. I have looked into Set, which guarantees uniqueness of the objects, but it does not allow efficient retrieval. At first I was wary about Richard's commenting out of properties. In principle every property has an effect on layout and must be looked up. But if we wish to release a production version, we cannot waste performance on such a principle. Therefore I think a careful commenting out of properties not looked up is useful. Regards, Simon > Richard, > > (In reply to comment #1) > > Created an attachment (id=19176) --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19176&action=view) [edit] [edit] > > Replace EnumProperty and EnumNumber constructors with getInstance() > > Looking again at your patch, one more remark: > The only thing that doesn't completely sit right with me, is the lookup based on an instance of the class > in question... This seems to me to defeat the purpose of reducing the instantiation rate. True, the > instance's scope remains limited to the getInstance() method, but they're created (and have to be GC'ed) > anyway :/ > > See my proposed change in Marker.java: the MarkerAttribute constructor is called only when no > corresponding instance exists in the map yet. I'm still chewing on how to generalize such an approach > in the properties package. > In the meantime, also did something similar for fo.expr.NumericProperty... again nothing broke, but I > still have to dig up a testcase, to see how precisely this impacts the resource consumption before > committing such stuff. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
