The equals method of EntityKey showed that it is doing string content comparisons for the entity name which is very wasteful. Interning the entity name will fix this.