Skip to content

Commit 4f90a02

Browse files
committed
Remove testRulesetRetrievalPerformance.
This flags in the AMO validator because of a synchronous network fetch. We may want to reinstate it later in the specific testing extension.
1 parent e6283a5 commit 4f90a02

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

src/chrome/content/code/HTTPSRules.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,6 @@ const HTTPSRules = {
425425
if (gitCommitQuery.executeStep()) {
426426
this.GITCommitID = gitCommitQuery.row.git_commit;
427427
}
428-
429-
try {
430-
if (HTTPSEverywhere.instance.prefs.getBoolPref("performance_tests")) {
431-
this.testRulesetRetrievalPerformance();
432-
}
433-
} catch(e) {
434-
this.log(WARN, "Exception during testing " + e);
435-
}
436428
return;
437429
},
438430

@@ -683,36 +675,6 @@ const HTTPSRules = {
683675
return results;
684676
},
685677

686-
testRulesetRetrievalPerformance: function() {
687-
// We can use this function to measure the impact of changes in the ruleset
688-
// storage architecture, potentiallyApplicableRulesets() caching
689-
// implementations, etc.
690-
var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
691-
.createInstance(Ci.nsIXMLHttpRequest);
692-
req.open("GET", "https://www.eff.org/files/alexa-top-10000-global.txt", false);
693-
req.send();
694-
var domains = req.response.split("\n");
695-
var domains_l = domains.length - 1; // The last entry in this thing is bogus
696-
var prefix = "";
697-
this.log(WARN, "Calling potentiallyApplicableRulesets() with " + domains_l + " domains");
698-
var count = 0;
699-
var t1 = new Date().getTime();
700-
for (var n = 0; n < domains_l; n++) {
701-
if (this.potentiallyApplicableRulesets(prefix + domains[n]).length != 0)
702-
count++;
703-
}
704-
var t2 = new Date().getTime();
705-
this.log(NOTE, count + " hits: average call to potentiallyApplicableRulesets took " + (t2 - t1) / domains_l + " milliseconds");
706-
count = 0;
707-
t1 = new Date().getTime();
708-
for (var n = 0; n < domains_l; n++) {
709-
if (this.potentiallyApplicableRulesets(prefix + domains[n]).length != 0)
710-
count++;
711-
}
712-
t2 = new Date().getTime();
713-
this.log(NOTE, count + " hits: average subsequent call to potentiallyApplicableRulesets took " + (t2 - t1) / domains_l + " milliseconds");
714-
},
715-
716678
/**
717679
* If a cookie's domain attribute has a leading dot to indicate it should be
718680
* sent for all subdomains (".example.com"), return the actual host part (the

translations

Submodule translations updated from fc0de70 to f81d74f

0 commit comments

Comments
 (0)