Skip to content

WIP: NoIssue - reduce the amount of .toLowerCase() calls

This MR exists as benchmark/low-hanging fruit when it comes to heap memory usage.

Simply avoiding lower-casing domains per each parsed filter, something apparently completely useless as domains are registered already lower-case, shows that we consume 5 up to 7MB less heap memory when parsing filters, due GC incapable of swapping inline references, hence being heavier for no reason on the CPU too.

A node --expose-gc --heap-prof benchmark.js EasyList+A with this branch, instead of next, should constantly show that gain in heap usage, but as we explicitly test against camelCase domains (or sitekeys for what it matters), we need to investigate how feasible is this proposed change.

Note this branch is expecting to fail because of tests actually looking for ignore-case behavior.

Edited by Andrea Giammarchi

Merge request reports