2.2 KiB
weight, title, description, icon, date, lastmod
weight | title | description | icon | date | lastmod |
---|---|---|---|---|---|
999 | Performance Guide | Performance guide for MoonVeil | article | 2025-05-01T18:47:58-05:00 | 2025-05-01T18:47:58-05:00 |
MoonVeil provides multiple solutions to improve and optimize the performance of your scripts.
Using the 'Fast VM' option
This preset is available in your dashboard's settings. If you're still having performance issues, continue reading.
Omitting Obfuscation from blocks
Not all code needs to be obfuscated. Large libraries that deal with unimportant code such as UI libraries, data serialization libraries, etc. can be left unobfuscated.
MoonVeil allows you to omit obfuscation from specific blocks of your script, by wrapping the block in an MV_OMIT
macro:
MV_OMIT(function()
for i = 0, 10 do
print(i)
end
end)()
Code that runs frequently (e.g. per game tick, render frame, or otherwise multiple times per second) may cause application freezes, drop FPS, reduce throughput, and increase latency even if optimized properly. Most of the time obfuscation is not necessary on these functions. For example:
game:GetService("RunService").RenderStepped:Connect(MV_OMIT(function()
Label.Text = "FPS: " .. game:GetService("Stats").FramesPerSecond
-- or whatever
end))
Obfuscation only through macros
Who says you need to obfuscate your whole script? If you know what you're doing, you can selectively tell MoonVeil to only obfuscate certain parts of your script using the MV_VM
, MV_ENC_FUNC
and MV_CFF
macros. This gives you much more control over the obfuscation process, you simply tell MoonVeil what parts of your script you want to obfuscate:
local getThing = MV_VM(function()
for i = 0, 10 do
print(i)
end
-- this will be SO slow, but does work!
MV_CFF(function()
for i = 0, 10 do
print(i)
end
end)()
return "hello world"
end)
MV_ENC_FUNC(function()
print('yay function unencrypted')
for i = 0, 10 do
print(i)
end
end, "hello world", getThing())()
Then using the Minify
preset will only run the passes you've specified. For a full list of macros, see the documentation.