brave-experiments / ad-block

Ad block engine used in the Brave browser for ABP filter syntax based lists like EasyList.
https://www.brave.com
Mozilla Public License 2.0
240 stars 95 forks source link

.dat serializations get _really_ big for rule lists that don't have a trailing "\n" #173

Closed pes10k closed 5 years ago

pes10k commented 5 years ago
> let ab = require("ad-block");
undefined
> let input = fs.readFileSync("input.txt", "utf8").trim()
undefined
> client = new ab.AdBlockClient()
AdBlockClient {}
> client.parse(input)
undefined
> client.serialize().length
96697404
> client2 = new ab.AdBlockClient()
AdBlockClient {}
> client2.parse(input + "\n")
undefined
> client2.serialize().length
518462
pes10k commented 5 years ago

input.txt

For use in the above example