Implement a ring buffer for this.log_
logs in LogStore is taken always, so adding log process must be fast. In this patch, a ring buffr is implemented. It takes O(1) time to add a log while Javascript shift() takes O(n) time. As a benchmark: 1550ms in average for writeLog 10e+7 times in prior patch. 700 ms in average for writeLog 10e+7 times in this patch. Bug: 874349 Change-Id: I49455787ecbf92583b5f63e838d7970783dc776d Reviewed-on: https://chromium-review.googlesource.com/1179432 Commit-Queue: Eriko Kurimoto <elkurin@google.com> Reviewed-by:David Tseng <dtseng@chromium.org> Reviewed-by:
Yuki Awano <yawano@chromium.org> Cr-Commit-Position: refs/heads/master@{#586216}
Showing
Please register or sign in to comment