Fix esmre CPU bottleneck #2129