Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Conversation

@cschanaj
Copy link
Collaborator

@cschanaj cschanaj commented Aug 28, 2017

@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.

Why Firefox test always fails?

}
log(DBUG, "Ruleset cache miss for " + host);

var tmp;
Copy link
Collaborator Author

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?

Copy link

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.

@cschanaj cschanaj changed the title Use Map insteads of Object for RuleSets.targets Use Map instead of Object for RuleSets.targets Aug 28, 2017
@Hainish
Copy link
Member

Hainish commented Aug 28, 2017

Checking on the firefox-dev test now.

@Hainish
Copy link
Member

Hainish commented Aug 29, 2017

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.

@ghost
Copy link

ghost commented Aug 29, 2017

@Hainish Nightly is unbranded by default and does not enforce extension signing.

1 similar comment
@ghost
Copy link

ghost commented Aug 29, 2017

@Hainish Nightly is unbranded by default and does not enforce extension signing.

@cschanaj
Copy link
Collaborator Author

cschanaj commented Aug 29, 2017

To disable signature checks, you will need to set the xpinstall.signatures.required preference to "false".

@Hainish It seems that you'd have to modify test/script.py to disable signature checking in the Developer Edition. Did you test it?

@Hainish
Copy link
Member

Hainish commented Aug 29, 2017

@Hainish
Copy link
Member

Hainish commented Aug 29, 2017

@cschanaj in the latest Firefox versions this pref does not change the behavior as they've made signature checking mandatory.

@cschanaj
Copy link
Collaborator Author

@Hainish okay. would you also review and merge this PR?

@Hainish
Copy link
Member

Hainish commented Aug 29, 2017

@cschanaj yes but it'll have to wait until at least tomorrow

@cschanaj
Copy link
Collaborator Author

@Hainish never mind, but I would like this to be merged before the next release given the performance boost it will provides. thanks.

@Hainish
Copy link
Member

Hainish commented Aug 31, 2017

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

@cschanaj
Copy link
Collaborator Author

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. 😄

@ghost
Copy link

ghost commented Aug 31, 2017

@Hainish Maybe use a bloom filter or a prefix list?

@cschanaj
Copy link
Collaborator Author

AFAIK, a bloom filter gives probabilistic results. And thus using a bloom filter might require a major rewrite.

@Hainish
Copy link
Member

Hainish commented Aug 31, 2017

@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!

@ghost
Copy link

ghost commented Aug 31, 2017

@Hainish We can verify positives by hashes or simply a list of acceptable targets.

@Hainish Hainish merged commit d522f4d into EFForg:master Aug 31, 2017
@cschanaj
Copy link
Collaborator Author

And a bloom filter give boolean results. The searching of applicable results is still inefficient.

@cschanaj cschanaj deleted the replace-object-with-map branch August 31, 2017 02:07
@cschanaj
Copy link
Collaborator Author

@Hainish thanks! I will work on using JSON instead of XML for default.rulesets in a later PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants