You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/02/13 21:55:46 UTC
DO NOT REPLY [Bug 33548] New: -
CaseInsensitiveMap performance optimization suggestion
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=33548>.
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=33548
Summary: CaseInsensitiveMap performance optimization suggestion
Product: Commons
Version: 3.1
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P4
Component: Collections
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: rickkw@yahoo.com
Hi,
I have written something similar until I found this class. I plan to use this
instead. When browsing the implementation I notice an opportunity to improve
performance of this class, and I'd like to make a suggestion.
1) Since this class works on keys of any type, and that only String (OK, maybe
StringBuffer) are meaningful when converting to lowercase, it is not necessary
to convert every key with key.toString().toLowerCase(). If the key is not of
String type, it should just return the object itself.
2) Often times, the same set of keys are used repeatedly, and since String
objects are immutable, it might help further optimize the repeating work of
converting the same key to lowercase by reusing already converted key objects of
String type by caching lowercase keys in an internal map.
I am referring to CaseInsensitiveMap.convertKey()
Thanks,
--
Rick
--
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org