-
Notifications
You must be signed in to change notification settings - Fork 971
Improvements for the startup time (Bloodhound) #10738
Conversation
Resolves brave#10723 Auditors: Test Plan:
Codecov Report
@@ Coverage Diff @@
## master #10738 +/- ##
==========================================
+ Coverage 54.1% 54.11% +<.01%
==========================================
Files 247 247
Lines 21519 21532 +13
Branches 3332 3331 -1
==========================================
+ Hits 11643 11652 +9
- Misses 9876 9880 +4
|
(note that this times can vary based on computer and computer usage) first commit improvementbefore chunks init: 12331.356ms init: 10831.314ms init: 10927.020ms init: 12617.369ms after chunks init: 8631.733ms init: 8809.358ms init: 8555.203ms init: 8622.259ms second commit improvementbefore immutable usage init: 8631.733ms init: 8809.358ms init: 8555.203ms init: 8622.259ms after immutable usage init: 8310.651ms init: 7965.882ms init: 7875.339ms init: 7754.056ms |
f39fc80
to
d227a1d
Compare
d227a1d
to
6daaf36
Compare
parsedHistorySites.push( | ||
urlParse(site.location) | ||
urlParse(site.get('location')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: this might be better like (to avoid calling get twice):
const siteLocation = site.get && site.get('location')
if (siteLocation) {
parsedHistorySites.push(
urlParse(siteLocation)
)
}
let host1 = s1.parsedUrl.host || s1.parsedUrl.pathname || s1.location || '' | ||
let host2 = s2.parsedUrl.host || s2.parsedUrl.pathname || s2.location || '' | ||
let host1 = s1.get('parsedUrl').host || s1.get('parsedUrl').pathname || s1.get('location') || '' | ||
let host2 = s2.get('parsedUrl').host || s2.get('parsedUrl').pathname || s2.get('location') || '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I'm missing something- shouldn't this be like:
s1.getIn(['parsedUrl', 'host'])
/ s1.getIn(['parsedUrl', 'pathname'])
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same with the changes below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic was not changed with this PR, so cc @bbondy for this thoughts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NejcZdovc it was changed from mutable to immutable though... which means you have to use get
in order to read the values. Trying to access like a mutable usually returns undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsclifton I see what you mean. Let me double check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsclifton yeah it's working correctly. You can have regular object in immutable object
Please don't squash commits
Submitter Checklist:
git rebase -i
to squash commits (if needed).Based on this testings #3025 (comment) (check section from 30.08.2017) with this fix startup time was reduced from ~12s to ~8.5s.
1 commit -> initial add is split into multiple chunks
2 commit -> bloodhound is using immutable
Resolves #10723
Auditors:
Test Plan:
Reviewer Checklist:
Tests