Commit Graph
2909 Commits
Author SHA1 Message Date
Michael Comella b0e91e0c44 Bug 1369604: Force lazily-loaded metadata to load on background thread. r=liuche
This undoes a caveat created from the last changeset; I did not profile this
change.

MozReview-Commit-ID: 6jpXyt0GRUj
2017-07-28 15:02:57 -07:00
Michael Comella f7e26ba71c Bug 1369604: Replace Metadata JSON parsing with faster regex matching. r=liuche
I replaced JSON parsing for all highlight candidates (at most, 500) with a
faster estimation using regex: we only use the full JSON parsing to get the
perfect values for the items to be shown (~5).

One caveat of this change: JSON parsing will be moved to the main thread when
the getMetadataSlow is lazily-loaded.

Disclaimer: my device seems to be running faster than yesterday so profiling
may not be consistent but here are the profiling results:
- HighlightsRanking.extractFeatures: 78.1% -> 54.5%
- Highlight.<init>: 26.5% -> 14.5%
- JSONObject.<init>: 11.4% -> rm'd
- initFast*: (replaced JSONObject.<init> & friends) -> 4.2%

With ^ the disclaimer in mind, runtime decreased from 12.6s to 5.3s (this is
slower due to profiling).

MozReview-Commit-ID: CTqAyDDmaJQ
2017-07-28 13:45:41 -07:00
Michael Comella ab925f8d97 Bug 1369604: Replace features HashMap with indexing into an array. r=liuche
After the previous changeset, some numbers stood out:
- HighlightsRanking.extractFeatures: 44.9%
- HighlightCandidate.getFeatureValue: 19.4%
- Collections.secondaryHash: 17.3%
- HashMap.get: 11.7%

My hypothesis was that our HighlightCandidate.features implementation was slow:
it was mapping FeatureNames -> values in a HashMap but HashMap look-ups are
slower than a direct memory access.

I replaced the implementation with a direct access from an array - about as
fast as we can get. This encouraged me to make some changes with the following
benefits:
- Rewrote HighlightsRanking.normalize to save iterations and allocations.
- Rm code from HighlightsRanking.scoreEntries: we no longer need to iterate to
construct the filtered items, we just index directly into the list
- Rewrote HighlightsRanking.decay(), which I think is a little clearer now.
- Saved a few iterator/object allocations inside inner loops in places.

The tests pass and we have coverage for the normalize changes but not for
scoreEntries.

---

For perf, my changes affected multiple methods so the percentages are no longer
reliable but I can verify absolute runtime changes. I ran three tests, the best
of which showed an overall 33% runtime compared to the previous changeset and
the other two profiles showed a 66% overall runtime. In particular, for the
middle run, the changes for affected methods go from X microseconds to Y
microseconds:
- Features.get: 3,554,796 -> 322,145
- secondaryHash: 3,165,785 -> 35,253
- HighlightsRanking.normalize: 6,578,481 -> 1,734,078
- HighlightsRanking.scoreEntries: 3,017,272 -> 448,300

As far as I know, my changes should not have introduced any new inefficiencies
to the code.

MozReview-Commit-ID: 9THXe8KqBbB
2017-07-26 17:16:14 -07:00
Michael Comella 2f4ebc22a9 Bug 1369604: Use HighlightCandidateCursorIndices to cache. r=liuche
This reduces the calls to `getColumnIndexOrThrow` to 9 (from 1.6k) and
HighlightsRanking.extractFeatures goes from 77.1% inclusive CPU time -> 40.8%,
14.6k ms -> 7.1k ms.

MozReview-Commit-ID: L6HqvBK5I4i
2017-07-24 18:12:05 -07:00
Michael Comella 147289f730 Bug 1386052: Join PageMetadata table with Top Sites query. r=Grisha
This bug does not request that this join is used so I tested this by adding a
breakpoint in StreamRecyclerAdapter.swapTopSites cursor and querying the cursor
for the desired fields directly. I also verified this does not crash when
accessing the old top sites and AS top sites.

Since I now SELECT a subset of columns (rather than *), I verified I've
SELECTed all the used columns:

- For AS, we bind in TopSite.fromCursor:
https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/model/TopSite.java#21

- For old top sites, we bind in TopSitesPanel.CursorLoaderCallbacks.onLoadFinished.
This fans out to three methods: mListAdapter.swapCursor, mGridAdapter.swapCursor,
and updateUiFromCursor, the latter which only gets the count.
https://dxr.mozilla.org/mozilla-central/rev/52285ea5e54c73d3ed824544cef2ee3f195f05e6/mobile/android/base/java/org/mozilla/gecko/home/TopSitesPanel.java#692

- mListAdapter = VisitedAdapter, mGridAdapter = TopSitesGridAdapter, via
TopSitesPanel.onActivityCreated:
https://dxr.mozilla.org/mozilla-central/rev/52285ea5e54c73d3ed824544cef2ee3f195f05e6/mobile/android/base/java/org/mozilla/gecko/home/TopSitesPanel.java#292

- VisitedAdapter.bindView:
https://dxr.mozilla.org/mozilla-central/rev/52285ea5e54c73d3ed824544cef2ee3f195f05e6/mobile/android/base/java/org/mozilla/gecko/home/TopSitesPanel.java#549

- TopSitesGridAdapter.bindView:
https://dxr.mozilla.org/mozilla-central/rev/52285ea5e54c73d3ed824544cef2ee3f195f05e6/mobile/android/base/java/org/mozilla/gecko/home/TopSitesPanel.java#620

- Both adapters don't use any columns I haven't specified. They also call out
to TwoLinePageRow.updateFromCursor:
https://dxr.mozilla.org/mozilla-central/rev/52285ea5e54c73d3ed824544cef2ee3f195f05e6/mobile/android/base/java/org/mozilla/gecko/home/TwoLinePageRow.java#318

Which also doesn't use new columns.

MozReview-Commit-ID: 9bdeHWLWQbh
2017-08-01 16:02:50 -07:00
Michael Comella 43913033d3 Bug 1386052: add Combined.HISTORY_GUID; upgrade db to 38. r=Grisha
This will be used to join with the PageMetadata table so we can extract
PageMetadata values in our top sites queries.

MozReview-Commit-ID: EmwjyFM1qUf
2017-08-01 14:21:54 -07:00
Michael Comella d86d93262c Bug 1386052: Correct PageMetadata.HISTORY_GUID foreign key. r=Grisha
This change is fixing an issue unrelated to this bug.

It was using Visits.HISTORY_GUID, which is not in the table and thus doesn't
make sense for the first clause of the foreign key constraint. Visits & its
replacement have the same value so the behavior should not change.

MozReview-Commit-ID: 8EbJh586DN3
2017-08-01 14:02:32 -07:00
maliu c72bb6f3d9 Bug 1316462 - Increase minsdk to 16 and remove EOL notification. r=sebastian, r=snorp, r=rnewman
MozReview-Commit-ID: 7o1xqIqVWC6
2017-07-27 08:27:08 -04:00
Michael Comella 69950dcd35 Bug 1377287 - review: Only update views if they're the same as when asyncTask began. r=mcomella
MozReview-Commit-ID: 8XA32VFNSH7
2017-07-26 15:32:14 -07:00
Michael Comella bbf75614f5 Bug 1377287 - review: getHostSLD returns empty str on error. r=mcomella
In response to https://bugzilla.mozilla.org/show_bug.cgi?id=1377287#c26:
getHostSLD should only return hosts.

MozReview-Commit-ID: IFN5FWjFLx4
2017-07-26 15:08:40 -07:00
Michael Comella 16ff4c7f6c Bug 1377287: Rm now unused ActivityStream.extractLabel. r=sebastian
MozReview-Commit-ID: KP2AxzVA3CL
2017-07-19 14:38:18 -07:00
Michael Comella 4243b92426 Bug 1377287: Use FFiOS label algorithm for BottomSheetContextMenu. r=sebastian
MozReview-Commit-ID: LWan7wVNASb
2017-07-19 14:36:14 -07:00
Michael Comella a9e7937f21 Bug 1377287: Update TopSitesCard label to iOS algorithm. r=sebastian
MozReview-Commit-ID: CIfFqABGmq7
2017-07-19 14:08:32 -07:00
Michael Comella f887059498 Bug 1377287: Update highlights label algorithm to match FFiOS. r=sebastian
MozReview-Commit-ID: KLRdP9wXh1N
2017-07-18 15:03:39 -07:00
Michael Comella f421a09225 Bug 1377287: Add URIUtils.getHostSecondLevelDomain and friends. r=liuche
This is used by the iOS implementation of AS to get the highlight titles.

MozReview-Commit-ID: 1p5Lf9OBcfD
2017-07-17 18:10:16 -07:00
Michael Comella cfd9380289 Bug 1377287: Rename HighlightItem internal views to something easier. r=sebastian
I could not make sense of the existing names at all.

Bug 1379021 is going to:
- Remove the vTimeSince view, so I didn't change the name
- Create a new layout file, so I didn't change the resource IDs accordingly

MozReview-Commit-ID: 1WUzyhrzQYZ
2017-07-17 13:20:29 -07:00
Sebastian Kaspari 464432f79d Bug 1379021 - Update top sites layout to match updated UI mocks. r=mcomella
MozReview-Commit-ID: JA2xMC2IONJ
2017-07-19 14:27:38 +02:00
Sebastian Kaspari cc136fcdc2 Bug 1379021 - Remove pager indicator from top sites. r=mcomella
MozReview-Commit-ID: 1mOmVwgplGF
2017-07-13 16:23:54 +02:00
Sebastian Kaspari eb8981b684 Bug 1379021 - Draw a horizontal divider between highlight items. r=mcomella
MozReview-Commit-ID: Er7TPfw6Xb3
2017-07-13 14:00:28 +02:00
Wes Kocher 8b4ccdffcf Merge m-c to autoland, a=merge
MozReview-Commit-ID: F1X8wKqbkg
2017-07-25 19:16:09 -07:00
cnevinc bb19e0422d Bug 1383762 - Change the event timing for adding a new normal tab. r=maliu
MozReview-Commit-ID: Lyf7yeTFpzq
2017-07-26 00:30:22 +08:00
Carsten "Tomcat" Book e570da6107 Merge mozilla-central to mozilla-inbound 2017-07-25 14:38:43 +02:00
Eugen Sawin d90ff0329c Bug 1381983 - [3.0] Add context menu support for media elements. r=snorp 2017-07-25 14:41:49 +02:00
Eugen Sawin ea4b3798dc Bug 1381983 - [2.1] Add default/stub implementations of the context menu handlers. r=snorp 2017-07-25 14:41:49 +02:00
Sebastian Kaspari 3ab3e0d54d Bug 1383081 - (DLC) DownloadAction: Flush stream before verifying checksum. r=mcomella
MozReview-Commit-ID: 9hrUM9Jv6dA
2017-07-21 17:45:22 +02:00
Nevin Chen 6207089b6f Bug 1383765 - Add Leanplum event for new tab for Tablet. r=maliu
MozReview-Commit-ID: ILTA0x6pDCx
2017-07-25 11:34:22 +08:00
Michael Comella 656076d2af Bug 1367024: Fix array index out of bounds in StreamRecyclerAdapter. r=liuche
I'm a little concerned that this will hide other bugs but it's pretty
complicated to track down without an STR (e.g. what are all the possible ways
we load the HomePager with TopSites as the default and swap in new highlights?
How about unloading? When is onSizeChanged called?) so I don't think it's worth
investigating further.

MozReview-Commit-ID: 6OuFJ2iQsdL
2017-07-19 16:35:44 -07:00
maliu 10a5307893 Bug 1382081 - Notify ICS user EOL, r=sebastian
MozReview-Commit-ID: 36clTSg6qKY
2017-07-18 19:00:00 +02:00
Chenxia Liu e2ff29720e Bug 1382489 - decode urls before opening them. r=mcomella
MozReview-Commit-ID: 9R6ytSgajEE
2017-07-20 17:17:42 -07:00
jwu 221885d43f Bug 1380983 - Show title as "Edit Folder" when editing a bookmark folder. r=Grisha
MozReview-Commit-ID: 7l20XXj2jHP
2017-07-24 09:06:51 +08:00
Nevin Chen d5c41e456b Bug 1366680 - Refresh Tab Tray UI. r=jwu,walkingice
For photon we need to add some colors.
I don't want change current color and dimen too much. I want to add new resources if possible to avoid confliction.
For Tab Items, there are three layout
1. AutoFitTabsGridLayout. Used in tablet-land/port  and phone-land
2. CompactTabsGridLayout. Used in phone-port(with pref on)
3. TabsListLayout. Used in phone-port(default)

In 1.2, we only constrain the gap of the Tab item padding and the layout padding.
In 3, we restrain the thumbnail width to 137dp .

I also make the tab strip longer for tablet. And I change the color of tab item border and set the thumbnail ratio to 4:3.

We might need to remove unused resources and test different density(2.6 and 3 are all xxhdpi!) and sw240,sw360,sw400 combination.

MozReview-Commit-ID: Gp25nG8NkR5
2017-07-13 18:02:54 +08:00
Sebastian Kaspari 6838b93f8f Bug 1386305 - (DLC) Remove outdated bootstrap catalog. r=mcomella
The bootstrap catalog is outdated and downloading files from it returns in 404 errors from the CDN.
It's impossible to keep the bootstrap catalog updated. Instead let's start with an empty catalog
and rely on the latest catalog that we synchronize from Kinto.

MozReview-Commit-ID: FduZWJBvj16
2017-08-02 18:10:13 +02:00
Dylan Roeh 17ddb6fa6c Bug 1377583 - Expose security information in custom tabs. r=snorp
This adds a class, CustomTabsSecurityPopup, which allows us to display information from the security certificate on secure sites.
2017-08-10 09:10:57 -05:00
Andrew Swan 35871a1aef Bug 1379833 Part 2: Display permissions dialog during extension install on Android
MozReview-Commit-ID: 721i0B0lC4n
2017-08-15 08:35:11 -07:00
Sebastian Hengst d5cdbedd23 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-09-08 00:07:48 +02:00
Eugen Sawin dbf95b2838 Bug 1397894 - [1.0] Fix GeckoView custom tabs URI loading. r=snorp 2017-09-07 22:47:55 +02:00
jwu 4d214bfc50 Bug 1381001 - Bump the folder's last modified timestamp when deleting it. r=Grisha
MozReview-Commit-ID: DeBZatIrDVg
2017-07-23 15:30:10 +08:00
Ryan VanderMeulen c7ea83669e Merge m-c to autoland. a=merge
CLOSED TREE
2017-07-21 09:42:41 -04:00
Sebastian Hengst 9a0f02dbef Backed out changeset 2edde0aaa0f6 (bug 1366671)
MozReview-Commit-ID: 4KukvTjyPya
2017-07-21 12:57:37 +02:00
Michael Kaply a4be6734d2 Bug 1373818 - Don't hardcode our tracker per Adjust. r=rnewman
MozReview-Commit-ID: 5O04Qp2IP9U
2017-07-07 14:27:58 -05:00
Tushar Saini (:shatur) 3614009511 Bug 1362994 - Add support for HashMap prefs in SharedPreferences r=sebastian
MozReview-Commit-ID: Dv2lHdZj5Zn
2017-05-29 16:28:48 +05:30
Sebastian Hengst dbbdc1320c merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 2kKTSo87OJy
2017-07-20 10:56:34 +02:00
Chenxia Liu c367abe294 Bug 1377295 - Use old Top Sites pinned sites in AS panel. r=mcomella
MozReview-Commit-ID: 6i3Cam8un45
2017-07-18 18:43:35 -07:00
jwu 9d6e7b31c4 Bug 1366671 - Part 2: Support empty screen in private tabs panel. r=walkingice
MozReview-Commit-ID: 6I7y68DO9g2
2017-07-19 18:25:00 +08:00
Isaac Schemm c7a79b1de1 Bug 1377765 - Apply calendar height workaround from bug 1245692 to Android 5.0.x. r=maliu 2017-07-08 08:54:00 -04:00
jwu 915f3d4f31 Bug 1366678 - Highlight substrings in search suggestion/history if they match search term. r=walkingice
MozReview-Commit-ID: KwpgBaaSYn1
2017-07-19 15:08:48 +08:00
Nevin Chen 135b606b7e Bug 1378445 - Add sound for notifications. r=snorp
MozReview-Commit-ID: EVLEfTeZOPg
2017-07-19 01:02:23 +08:00
friedger e634ebc091 Bug 1366993 - With "Don't keep activities" on, search activity's 'New tab' doesn't work r=maliu
add handling of about:home in intent.data  explicitly.

MozReview-Commit-ID: D46VVQaR0Z1
2017-06-08 15:12:10 +02:00
Michael Comella 884bf339f6 Bug 1341275 - review: Add comment explaining FaviconView.getWidth non-zero values. r=mcomella
MozReview-Commit-ID: 33RXaB4gCkK
2017-07-17 11:37:45 -07:00
Michael Comella 6959592695 Bug 1341275: Add mShouldShowImage flag to FaviconView. r=sebastian
I verified this fixed the issue by:
- Attaching a debugger and checking against the STR call order (comment 3).
- Ensuring the favicons in the SearchEngineRow looked correct

MozReview-Commit-ID: GJeh3FLim36
2017-07-14 15:44:21 -07:00