Partial fix for #2129 "esmre CPU bottleneck"