mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-25 23:25:44 +00:00
[HER-1762] H3 performance tuning
* KeyedProperties.java
avoid allocation hotspot shown by profiling (creating iterator for empty collection)
This commit is contained in:
@@ -56,13 +56,15 @@ public class KeyedProperties extends ConcurrentHashMap<String,Object> {
|
||||
* @return discovered override, or local value
|
||||
*/
|
||||
public Object get(String key) {
|
||||
for(OverlayContext ocontext: threadOverrides.get()) {
|
||||
for(String name: ocontext.getOverlayNames()) {
|
||||
Map<String,Object> m = ocontext.getOverlayMap(name);
|
||||
for(String ok : getOverrideKeys(key)) {
|
||||
Object val = m.get(ok);
|
||||
if(val!=null) {
|
||||
return val;
|
||||
if(!threadOverrides.get().isEmpty()) {
|
||||
for(OverlayContext ocontext: threadOverrides.get()) {
|
||||
for(String name: ocontext.getOverlayNames()) {
|
||||
Map<String,Object> m = ocontext.getOverlayMap(name);
|
||||
for(String ok : getOverrideKeys(key)) {
|
||||
Object val = m.get(ok);
|
||||
if(val!=null) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user