I've been trying to figure out why a userscript I'm working on is slow in Firefox yet blazing in Chrome and Safari. One reason I've identified (though maybe not the only reason) is that the large file size of the userscript is having a big effect. The script has ten book length strings in it, for a file size of 3.8 MB. If I remove the strings the script gets fast again---basically everything in the browser grinds to a halt while the file loads (right at the time for a typical user input interaction).
So I was thinking it might help to precompress the strings, then uncompress as needed during the run. Anyone have a strategy for doing this within a userscript?