@Nullable private Map<String, Object> prepareLoadSpec(@Nullable Map<String, Object> loadSpec) { if (loadSpec == null) { return null; } // Load spec is just of 3 entries on average; HashMap/LinkedHashMap consumes much more memory than ArrayMap Map<String, Object> result = new Object2ObjectArrayMap<>(loadSpec.size()); for (Map.Entry<String, Object> e : loadSpec.entrySet()) { result.put(STRING_INTERNER.intern(e.getKey()), e.getValue()); } return result; }
this.shutdownAccessLogWriterOnStop = shutdownAccessLogWriterOnStop; this.channelOptions = Collections.unmodifiableMap( new Object2ObjectArrayMap<>(requireNonNull(channelOptions, "channelOptions"))); this.childChannelOptions = Collections.unmodifiableMap( new Object2ObjectArrayMap<>(requireNonNull(childChannelOptions, "childChannelOptions"))); this.clientAddressSources = ImmutableList.copyOf( requireNonNull(clientAddressSources, "clientAddressSources"));
public Trie put(IString key, Trie trie) { if (map == null) { map = new Object2ObjectArrayMap<IString, Trie>(); // map = new Object2ObjectOpenHashMap<IString,Trie>(); // map = new HashMap<IString,Trie>(); } return map.put(key, trie); }
@Nullable private Map<String, Object> prepareLoadSpec(@Nullable Map<String, Object> loadSpec) { if (loadSpec == null) { return null; } // Load spec is just of 3 entries on average; HashMap/LinkedHashMap consumes much more memory than ArrayMap Map<String, Object> result = new Object2ObjectArrayMap<>(loadSpec.size()); for (Map.Entry<String, Object> e : loadSpec.entrySet()) { result.put(STRING_INTERNER.intern(e.getKey()), e.getValue()); } return result; }