bug 848238 - perf win with history.length check