Add cache for CommitLog objects to avoid refetching same commit.
authordewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 07:36:34 +0000 (07:36 +0000)
committerdewei_zhu@apple.com <dewei_zhu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 07:36:34 +0000 (07:36 +0000)
commitead4f22da38b978183cf9abcc38722e5305cae93
tree886679d9a295077fad7af105e3bcd728cd699120
parent64bb2277bcc3f475c6d548d3048ab5c29a136381
Add cache for CommitLog objects to avoid refetching same commit.
https://bugs.webkit.org/show_bug.cgi?id=191621

Reviewed by Ryosuke Niwa.

Added a cache for fully fetched commit log objects to avoid refetching.

* public/v3/models/commit-log.js:
(CommitLog): Added assertion for id.
Removed unused 'remoteId' as it has been removed since r198479.
(CommitLog.async.fetchBetweenRevisions): Turned it into async function.
(CommitLog.async.fetchForSingleRevision): Added the logic to check cache before fetching.
(CommitLog._constructFromRawData): Added logic to add entries to cache.
* public/v3/models/commit-set.js: Fixed measurement set not passing commit id while constructing a
commit log object.
* public/v3/models/repository.js: Added the ability to track fetched commit for certain repository.
(Repository.commitForRevision): Returns a commit for given revision.
(Repository.setCommitForRevision): Sets commit for a given revision.
* unit-tests/commit-log-tests.js: Added unit tests for this change.
Fixed existing tests.
* unit-tests/commit-set-range-bisector-tests.js: Fixed unit tests.
* unit-tests/commit-set-tests.js: Fixed unit tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v3/models/commit-log.js
Websites/perf.webkit.org/public/v3/models/commit-set.js
Websites/perf.webkit.org/public/v3/models/repository.js
Websites/perf.webkit.org/unit-tests/commit-log-tests.js
Websites/perf.webkit.org/unit-tests/commit-set-range-bisector-tests.js
Websites/perf.webkit.org/unit-tests/commit-set-tests.js