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

Issue 29909576: [experiment] Issue 7045 - Optimize V8 memory layout of filter text

Created:
Oct. 14, 2018, 4:38 a.m. by Manish Jethani
Modified:
March 19, 2019, 8:25 a.m.
Reviewers:
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Description

This patch reduces the initial memory footprint by ~3.8 MB on V8 by optimizing the memory layout of filter text containing very long (1,000+ characters) domains. To test this patch: 1. Do a fresh install of ABP built from source, let the first-run page open up, open Task Manager in Chrome and close all tabs 2. Rebuild from source, wait for the extension to load, wait a few seconds for GC to kick in, and observe the "live" JavaScript memory in Task Manager 3. Apply the patch and repeat step 2 In step 2, the memory used (heap) should be ~40,500 KB. In step 3, it should be down to ~36,500 KB.

Patch Set 1 : #

Patch Set 2 : Remove check in lib/filterClasses.js #

Patch Set 3 : Make domains parameter nullable and optional #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -0 lines) Patch
M lib/filterClasses.js View 1 3 chunks +8 lines, -0 lines 0 comments Download
A lib/filterText.js View 1 2 1 chunk +158 lines, -0 lines 0 comments Download
A test/filterText.js View 1 chunk +106 lines, -0 lines 0 comments Download

Messages

Total messages: 6
Manish Jethani
Oct. 14, 2018, 4:38 a.m. (2018-10-14 04:38:28 UTC) #1
Manish Jethani
Patch Sets 1-3 This patch is black magic, but if you apply it you'll find ...
Oct. 15, 2018, 9:52 p.m. (2018-10-15 21:52:49 UTC) #2
hub
My concern here is this change that is across platforms is made with v8 internals ...
Oct. 16, 2018, 3:30 p.m. (2018-10-16 15:30:19 UTC) #3
Manish Jethani
On 2018/10/16 15:30:19, hub wrote: > My concern here is this change that is across ...
Oct. 16, 2018, 8:02 p.m. (2018-10-16 20:02:07 UTC) #4
Manish Jethani
On 2018/10/16 20:02:07, Manish Jethani wrote: > Peak memory too is higher at ~97 MB ...
Oct. 16, 2018, 8:09 p.m. (2018-10-16 20:09:28 UTC) #5
Manish Jethani
Oct. 21, 2018, 1:22 p.m. (2018-10-21 13:22:45 UTC) #6
There is another way to do this that might be cleaner and have benefits on
Firefox as well, let me try it out.

Powered by Google App Engine
This is Rietveld