Open Bug 1857688 Opened 1 year ago Updated 4 months ago

Online JS utility can be upto 3x slower in Nightly compared to Chrome

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug, )

Details

Go to https://wiremask.eu/tools/xor-cracker/
Drop a unencrypted image file (i used a 15MB image file)
The utility will try to decrypt it, and eventually fail (because the input file is unencrypted)

nightly: https://share.firefox.dev/3RJmeI8 (87 seconds)
Chrome: https://share.firefox.dev/3tpsWsM (32seconds)

We spend a lot of time doing slow in operations for the function below. The megamorphic cache fails, I think because c can be an index and the megamorphic cache doesn't support those.

XorCracker.prototype.charsCountAtOffset = function(text, keyLength, offset) {
	var charsCount = new Array();

	for(var pos = offset; pos < text.length; pos += keyLength) {
		var c = text.substr(pos, 1);

		if(c in charsCount) {
			charsCount[c] += 1;
		} else {
			charsCount[c] = 1;
		}
	}

	return charsCount;
};
Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.