Skip to content

Commit

Permalink
Better default size for global index -> alias map
Browse files Browse the repository at this point in the history
The alias -> (index -> alias) map, specifically the index -> alias one, typically just hold one entry, yet we eagerly initialize it to the number of indices. When there are many indices, each with many aliases, this is a very large overhead per alias...
closes elastic#6504
  • Loading branch information
kimchy committed Jun 15, 2014
1 parent bb3c68a commit 83fac32
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -191,7 +191,7 @@ public static <T extends Custom> Custom.Factory<T> lookupFactorySafe(String type
AliasMetaData aliasMd = aliasCursor.value;
ImmutableOpenMap.Builder<String, AliasMetaData> indexAliasMap = (ImmutableOpenMap.Builder<String, AliasMetaData>) tmpAliases.get(aliasMd.alias());
if (indexAliasMap == null) {
indexAliasMap = ImmutableOpenMap.builder(indices.size());
indexAliasMap = ImmutableOpenMap.builder(1); // typically, there is 1 alias pointing to an index
tmpAliases.put(aliasMd.alias(), indexAliasMap);
}
indexAliasMap.put(index, aliasMd);
Expand Down

0 comments on commit 83fac32

Please sign in to comment.