Discussions » Greasy Fork Feedback

Feature request: Allow for site generated minified version

§
Posted: 10.02.2019.

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: 10.02.2019.

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

§
Posted: 11.02.2019.

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.

woxxomMod
§
Posted: 14.02.2019.
Edited: 14.02.2019.

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: 14.02.2019.

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: 18.02.2019.

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: 31.05.2022.

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: 07.03.2024.

Make this happen

Post reply

Sign in to post a reply.