WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
191621
Add cache for CommitLog objects to avoid refetching same commit.
https://bugs.webkit.org/show_bug.cgi?id=191621
Summary
Add cache for CommitLog objects to avoid refetching same commit.
dewei_zhu
Reported
2018-11-13 20:25:25 PST
Add cache for CommitLog objects to avoid refetching same commit.
Attachments
Patch
(14.11 KB, patch)
2018-11-13 20:32 PST
,
dewei_zhu
no flags
Details
Formatted Diff
Diff
Patch
(15.41 KB, patch)
2018-11-13 21:19 PST
,
dewei_zhu
no flags
Details
Formatted Diff
Diff
Patch
(18.40 KB, patch)
2018-11-13 22:32 PST
,
dewei_zhu
rniwa
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
dewei_zhu
Comment 1
2018-11-13 20:32:50 PST
Created
attachment 354760
[details]
Patch
Ryosuke Niwa
Comment 2
2018-11-13 20:43:48 PST
Comment on
attachment 354760
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=354760&action=review
> Websites/perf.webkit.org/ChangeLog:11 > + (CommitLog): Added assertion for id. Removed unused 'remoteId'.
Refer to
r198479
where the relevant code was removed.
> Websites/perf.webkit.org/public/v3/models/commit-log.js:174 > + const commit = this.ensureNamedStaticMap(`repository-${repository.id()}`)[revision];
ensureNamedStaticMap shouldn't be called with a dynamically generated name like this because it would be slow. In general, ensureNamedStaticMap is designed to work with a small fixed number of maps. Instead, this.ensureNamedStaticMap('repositoryMap') should have a map. Maybe an even better design is for each instance of a Repository object to have this map although it's slightly inelegant to reference CommitLog and Repository like that.
dewei_zhu
Comment 3
2018-11-13 21:19:12 PST
Created
attachment 354765
[details]
Patch
Ryosuke Niwa
Comment 4
2018-11-13 21:42:24 PST
Comment on
attachment 354765
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=354765&action=review
> Websites/perf.webkit.org/public/v3/models/commit-log.js:174 > + const commit = repository.ensureNamedStaticMap('revision')[revision];
Oh, no, that's not what I mean. ensureNamedStaticMap is per class so this is simply an alias to Repository.ensureNamedStaticMap('revision') You'd have to create your own instance variable on Repository. Please add a test for this. If you called fetchForSingleRevision on two different repositories, it would override each other with the current patch.
dewei_zhu
Comment 5
2018-11-13 22:32:46 PST
Created
attachment 354772
[details]
Patch
Ryosuke Niwa
Comment 6
2018-11-13 22:54:55 PST
Comment on
attachment 354772
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=354772&action=review
> Websites/perf.webkit.org/ChangeLog:12 > + Removed unused 'remoteId' has it has been removed since
r198479
.
s/has it has/as it has/
> Websites/perf.webkit.org/public/v3/models/repository.js:38 > +
No need for a blank line here.
dewei_zhu
Comment 7
2018-11-13 23:37:13 PST
Landed in
r238167
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug