-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use Map instead of Object for RuleSets.targets #12160
Conversation
| } | ||
| log(DBUG, "Ruleset cache miss for " + host); | ||
|
|
||
| var tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, this variable is not being used. Should I remove it in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cschanaj I will remove unused variables in one of my PRs.
|
Checking on the |
|
Despite a note to the contrary, it looks like the developer edition is now strictly enforcing xpi signatures. I've updated the https://github.com/EFForg/https-everywhere-docker-base URL to point to the unbranded edition of Firefox Dev, so once that is done building I can re-run the tests and we should be good. |
|
@Hainish Nightly is unbranded by default and does not enforce extension signing. |
1 similar comment
|
@Hainish Nightly is unbranded by default and does not enforce extension signing. |
@Hainish It seems that you'd have to modify |
|
@cschanaj in the latest Firefox versions this pref does not change the behavior as they've made signature checking mandatory. |
|
@Hainish okay. would you also review and merge this PR? |
|
@cschanaj yes but it'll have to wait until at least tomorrow |
|
@Hainish never mind, but I would like this to be merged before the next release given the performance boost it will provides. thanks. |
|
This is great. Efficiency can be further improved by utilizing a radix trie, indexed by the string reversal of the target (moc.elpmaxe) but this is contingent upon #11203 |
|
I agree a radix trie should be the best structure for the domains, but we will have to wait #11203 is completed. So I guess using Map could be a easy fix in the short term. 😄 |
|
@Hainish Maybe use a bloom filter or a prefix list? |
|
AFAIK, a bloom filter gives probabilistic results. And thus using a bloom filter might require a major rewrite. |
|
@koops76 bloom filters are only appropriate solutions when false positives are acceptable. That's not true here - we don't want to DoS a site unintentionally! |
|
@Hainish We can verify positives by hashes or simply a list of acceptable targets. |
|
And a bloom filter give boolean results. The searching of applicable results is still inefficient. |
|
@Hainish thanks! I will work on using JSON instead of XML for default.rulesets in a later PR. |
@Hainish this will notably improve performance and memory usage, as suggested in #1775 (comment), whereas the performance is measured by https://jsperf.com/es6-map-vs-object-properties/42.
WhyFirefoxtest always fails?