Discussions » Greasy Fork Feedback

Feature request: Allow for site generated minified version

§
Posted: 2019-02-10

Feature request: Allow for site generated minified version

I would like to offer a minified version of the full script, (preferably automatically generated by greasyfork), besides the full script so that people can choose what version they want to use.

Would something like that be possible?

Thanks,

wOxxOmMod
§
Posted: 2019-02-10

I second the request. Browsers parse, compile, and execute a minified script noticeably faster.

§
Posted: 2019-02-11

It doesn't matter on downloading time for user script because it's only once for downloading to local. Parsing and compiling performance may be faster, but is it valuable on 10ms to 5ms ? If the executing performance differs, it's worth minifying. But I can't find any comparison. Once it compiled by js engine, I suppose there are no difference on minifying or not.

§
Posted: 2019-02-13

I'm -1 on this. It may marginally faster to download and parse, but it's at the expense of readability.

wOxxOmMod
§
Posted: 2019-02-14
Edited: 2019-02-14

The performance difference depends on the script complexity, the amount of scripts, and the computer performance. For example in Chrome userscript managers such as Tampermonkey don't have any other choice but to send a huge JSON with all the scripts and their data into each tab and iframe so the time to stringify and parse such a JSON could be easily 100ms depending on the machine. Even if only 5 - 10ms of which is shaved by using minification it'd be a nice small boost. Add to that similar small boosts from compiling and parsing as well as reduced memory usage for the source code and you would see quite a noticeable boost.

As for compiled code performance, I've seen the difference as much as 500ms on a very fast 4GHz machine, which was due to a minifier that could shorten the object property names in a script that used those a lot (LZString compressor) so the runtime performance improved as JavaScript uses hashing to access objects in dictionary mode (aka hash tables).

That said, I think this feature request should be implemented by the userscript manager locally as an option.

§
Posted: 2019-02-14

I suggested to have both, so readability of the script remains as it was. I felt the option to also have a minified version could be interesting for some. It could possibly also show me who is interested in the source, and who just want the functionality.

§
Posted: 2019-02-15

Yeah, it would make most sense to me for the script manager to do this if it's indeed such a performance boost.

§
Posted: 2019-02-18

Yes, I would not want you to allow anyone to add their own minified files on your site of course, but rather that the script manager generates the minified one, when the readable script is updated. This should keep it all safe.

§
Posted: 2022-05-31

I agree. I liberally comment my scripts to try and make the understandable to non-programmers. Those comments contribute to browser bloat, so someone who just wants to run the code and not modify it would be better off with a minified version. Heck I'd want a minified version on my non development systems.

§
Posted: 2024-03-07

Make this happen

Post reply

Sign in to post a reply.