Does minifying scripts increase performance?

It’s common practice in eg. web development to minify and bundle files which can have a big effect even with small websites, but I don’t see it that much here, so does it have a noticeable effect? (for reference, I’m using Stravant’s Minify and Beautify). It makes the file a lot smaller, so I’m guessing the loading time of the game is smaller as well, but when I tested it on a (very old) large script it seemed to have an effect of <0.1s while the total loading time took ~0.7s. And apart from loading time, can it increase runtime performance?

1 Like

No, probably not.

Scripts are converted to bytecode before being sent to the client (citation needed), which removes anything cosmetic like variable names or whitespace or parentheses.


Ah yeah I guess. Well, good to know! I’ll probably still minify them if it takes less time to convert them that way.

1 Like

I don’t think it’s gonna be much of an improvement, the time it takes to send the bytecode over the network will absolutely dwarf the compilation speed:

Note: Compilation throughput isn’t the main focus in Luau, but our compiler is reasonably fast; with all currently implemented optimizations enabled, it compiles 400K lines of Luau code in 0.5 seconds on a single core of a desktop Core i7 CPU, producing bytecode and debug information

Performance - Luau