JCR-2125: Fixed the root cause of the perf regressions