Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5172657418928128: Determine the frame structure (Closed)

Created:
Nov. 22, 2013, 11:55 p.m. by Felix Dahlke
Modified:
Nov. 27, 2013, 3:07 p.m.
Visibility:
Public.

Description

Now we can finally put all the pieces together and pass the frame structure into libadblockplus. Note that there's a big TODO left, but I'm not sure how to best address it: We need to garbage collect and possibly persist referrer mappings. Garbage collection of some sort is probably necessary so we don't run out of memory with a long-running proxy. I was thinking of a simple priority queue that prioritises long referrer chains over short ones. I believe that persistence is necessary because clients will cache some requests, therefore we won't be able to build the full referrer chain if ABP restarted in the mean time (that's actually a reproducible problem). Thoughts?

Patch Set 1 : #

Total comments: 4

Patch Set 2 : Use LRU caching for the referrer mappings #

Total comments: 8

Patch Set 3 : Map referrers 1:1, use a more reasonable initial cache size #

Total comments: 2

Patch Set 4 : Build referrer chains iteratively and limit their length #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -9 lines) Patch
M jni/abpEngine.cpp View 1 2 chunks +16 lines, -7 lines 0 comments Download
M src/org/adblockplus/android/ABPEngine.java View 1 1 chunk +1 line, -1 line 0 comments Download
M src/org/adblockplus/android/AdblockPlus.java View 1 2 3 4 chunks +44 lines, -1 line 0 comments Download

Messages

Total messages: 9
Felix Dahlke
Nov. 23, 2013, 12:15 a.m. (2013-11-23 00:15:58 UTC) #1
Wladimir Palant
Why not use an LRU approach to the referrer mapping? IMHO, you are overcomplicating. We ...
Nov. 25, 2013, 10:24 a.m. (2013-11-25 10:24:41 UTC) #2
Felix Dahlke
Yes, an LRU should definitely do for now. I don't think we'll get around persisting ...
Nov. 27, 2013, 12:19 p.m. (2013-11-27 12:19:32 UTC) #3
Wladimir Palant
http://codereview.adblockplus.org/5172657418928128/diff/5668600916475904/src/org/adblockplus/android/AdblockPlus.java File src/org/adblockplus/android/AdblockPlus.java (right): http://codereview.adblockplus.org/5172657418928128/diff/5668600916475904/src/org/adblockplus/android/AdblockPlus.java#newcode380 src/org/adblockplus/android/AdblockPlus.java:380: referrers.add(referrer); On 2013/11/27 12:19:32, Felix H. Dahlke wrote: > ...
Nov. 27, 2013, 12:59 p.m. (2013-11-27 12:59:01 UTC) #4
Felix Dahlke
Issues addressed/commented. http://codereview.adblockplus.org/5172657418928128/diff/5668600916475904/src/org/adblockplus/android/AdblockPlus.java File src/org/adblockplus/android/AdblockPlus.java (right): http://codereview.adblockplus.org/5172657418928128/diff/5668600916475904/src/org/adblockplus/android/AdblockPlus.java#newcode380 src/org/adblockplus/android/AdblockPlus.java:380: referrers.add(referrer); On 2013/11/27 12:59:01, Wladimir Palant wrote: ...
Nov. 27, 2013, 1:38 p.m. (2013-11-27 13:38:59 UTC) #5
Wladimir Palant
http://codereview.adblockplus.org/5172657418928128/diff/5071437253574656/src/org/adblockplus/android/AdblockPlus.java File src/org/adblockplus/android/AdblockPlus.java (right): http://codereview.adblockplus.org/5172657418928128/diff/5071437253574656/src/org/adblockplus/android/AdblockPlus.java#newcode413 src/org/adblockplus/android/AdblockPlus.java:413: } Please don't use recursive algorithms where they don't ...
Nov. 27, 2013, 2 p.m. (2013-11-27 14:00:29 UTC) #6
Felix Dahlke
Issues addressed. http://codereview.adblockplus.org/5172657418928128/diff/5071437253574656/src/org/adblockplus/android/AdblockPlus.java File src/org/adblockplus/android/AdblockPlus.java (right): http://codereview.adblockplus.org/5172657418928128/diff/5071437253574656/src/org/adblockplus/android/AdblockPlus.java#newcode413 src/org/adblockplus/android/AdblockPlus.java:413: } On 2013/11/27 14:00:30, Wladimir Palant wrote: ...
Nov. 27, 2013, 2:47 p.m. (2013-11-27 14:47:31 UTC) #7
Wladimir Palant
LGTM
Nov. 27, 2013, 3:01 p.m. (2013-11-27 15:01:12 UTC) #8
Felix Dahlke
Nov. 27, 2013, 3:06 p.m. (2013-11-27 15:06:40 UTC) #9
Here's the follow-up for persisting the cache:
https://trello.com/c/FKaiTjta/344-persist-cached-referrer-mappings

Powered by Google App Engine
This is Rietveld