I mean Luau has to take every single comment out one by one before running my code Sooo
It will probably take microseconds but what if I need those microseconds man? Come on now
I mean Luau has to take every single comment out one by one before running my code Sooo
It will probably take microseconds but what if I need those microseconds man? Come on now
Nope, It doesn’t… Comments are stripped out before the script gets executed… When your code is parsed and compiled, the interpreter or JIT compiler completely ignores comments, they’re not included in the bytecode that actually runs in the Roblox engine, or basically they don’t make it into the runtime
I think it does because the C++ code has to remove it and THEN run it so that means it will take some time before they can ACTUALLY run the code
Um yeah it might then again u might wanna do some benchmarks to verify if u can.
What do you need those microseconds for though? Let me guess, micro-optimizing?
Yes
I wonder if minifying also makes Luau run faster, like JavaScript
I mean probably? But what is the use case here? Are you just playing around with studio? If so then alright. But remember scalability always takes priority over a micro-optimisation in real scenarios.
alr lemme clarify things here: the luau parser reads ur code and builds an internal structure it actually runs, and comments just never get included. then the bytecode gets generated (all done on the server) and that’s what gets sent to the client for local scripts, where luau basically runs it. so nobody ever sees ur original code on the client. compiling them to something not understandable by humans is legit basic cybersecurity 101.
. if someone tries to decompile the bytecode, they can recreate something readable, but it’s really not ur exact source code. and to mention, comments are gone (well done server👍). micro optimizing by removing comments? completely pointless bro ![]()
Nope
Minifying it at best may speed up the compile time, but it is not worth it.
Your only goal is having the bytecode good; everything else is noise.
You are correct that the client only obtains compiled bytecode, but
Can you please stop using ChatGPT? It’s not funny anymore.
No human pastes ** in a random sentence and puts weird ahh ChatGPT emojis in the message.
If you don’t know the topic, THEN LEAVE.
If OP needs the help of LLM, he might as well ask one himself.
Bro I am literally ChatGPT why do I need to ask myself
For the record it’s Lua, got changed like friends to connections, games to experiences, and group to community. Someone that knows Lua outside of Roblox knows how to code in roblox.
While more characters can make it slightly laggier, it won’t effect performance in play test/in game
@Chatgpt_forum Are comments code
cool ur ego down lil bro
oi yarik im literally emphasizing my important stuff with bold text so devs dont miss them. an example: a dev tries to find answers but don’t wanna read a whole comic book, bold text just makes the answer more obvious. im telling u haven’t messed around with microsoft words before? i got experiences outside just programming. im literally following the modern trend here, u see emojis flagged everywhere? “THAT THING IS AI!!!1!!” (what bro u have phobias of AIs?). using emojis just make it relatable for modern devs and makes it not look dry
. standing up for myself in ur topic doesn’t mean im flexing or even asking for drama. (chill out, what did u think was gonna happen
). focus on the actual content of a topic bro why did u have to spit this out here ![]()
I’d assume Roblox strips comments when publishing scripts, along with other preprocessing that prepares the code to run on the Roblox engine.
This sounds like a lexer or tokenizer phase doing the same type of preprocessing.
The Roblox engine also strips comments during parsing, before generating bytecode.
yes
when running in Studio - hundreds of times slower, even more when the Watch panel is on
when running by Player with developer console on-screen - also yes
roblox doesn’t have what is known as Debug and Release builds in other languages - therefore comments and debug messages are always part of the bytecode; prove me wrong
This sounds like a mission. I like to save older commented versions in stored archive files, and separated project work.
Yes they make your script immensely slower
crazy bump
Bruh, accidentally set a comment as solution.