Open Bug 1503481 Opened 6 years ago Updated 1 year ago

Cache visited URLs more efficiently in `GeckoViewHistory`

Categories

(GeckoView :: General, enhancement, P5)

enhancement

Tracking

(Not tracked)

People

(Reporter: lina, Unassigned)

References

Details

GeckoViewHistory currently stores URI hash keys in `mTrackedLinks` (each of which holds an `nsIURI` pointer: https://searchfox.org/mozilla-central/rev/fc3d974254660b34638b2af9d5431618b191b233/netwerk/base/nsURIHashKey.h#63), and removes them once all links have been notified.

This means we need to query the delegate again and incur two IPC messages and two JNI calls every time we see a link that we already checked. Since we don't actually need the original URI, what if we stored just the hash in `mTrackedLinks` instead, and kept the entries around with `mStatus == TrackedURIStatus::Visited`?

Alternatively, or maybe in addition to the above, we could add LRU eviction for visited URIs. Both would let us cut down on memory use.

Bug 1197866 is related. `GlobalHistory` stores the visited set on the Java side, but I imagine the same would apply to C++.
Lina looks like you are taking this bug?
Assignee: nobody → lina
Priority: -- → P2
See Also: → 1442659
Product: Firefox for Android → GeckoView

I think this is worth doing someday (and it's not quite a "good first bug"—but a good bug for a more experienced contributor), but not urgent. We can revisit if history lookups in our mobile apps turn out to be a bottleneck.

Assignee: lina → nobody
Priority: P2 → P5

Bug 1594368, comment 1 suggests doing just that!

See Also: → 1594368
See Also: → 484928
Severity: normal → S3

Enhancements should have severity N/A.

Severity: S3 → N/A
You need to log in before you can comment on or make changes to this bug.