VM complexity scripting function
VM complexity scripting function
It is possible to set virtualization complexity on per-function basis using GUI, but there is no method to control that in LUA class IntelFunction
Re: VM complexity scripting function
Added in the 2377 build.
Re: VM complexity scripting function
IntelFunction:setComplexity, I see, thanks!
Re: VM complexity scripting function
Hey, I just discovered this function, so far it wasn't documented.
I went ahead and tried it, it seems to set a numeric value to the lua bound function variable, but the value has absolutely no impact on the actual complexity. Regardless of what I set the value to, the function runs at the same speed, 1 or 100 doesn't matter.
Doing so in the UI has a drastic affect on the speed so that seems to work (Using 3.9.6).
In case Im using it wrong, heres the 3 lines:
I went ahead and tried it, it seems to set a numeric value to the lua bound function variable, but the value has absolutely no impact on the actual complexity. Regardless of what I set the value to, the function runs at the same speed, 1 or 100 doesn't matter.
Doing so in the UI has a drastic affect on the speed so that seems to work (Using 3.9.6).
In case Im using it wrong, heres the 3 lines:
Code: Select all
local Func = File:functions():addByAddress(MapFunc:address(), CompilationType.Virtualization)
assert(Func)
Func:setComplexity(1)
Last edited by vmenter on Mon Sep 08, 2025 2:36 pm, edited 2 times in total.
Re: VM complexity scripting function
The Complexity only affects the size of virtualized code and doesn't affect its speed.
Re: VM complexity scripting function
Thanks for your answer!
After some debugging I figured out that you are right, the reason the VM is so much slower is that the Import Protection feature is enabled.
Apparently, that makes the vmenter/exit much much slower which leads to bad performance in my code as the function is called VERY frequently but doesn't have much code to execute.
Do you think it would be possible to add an option to generate a different VM for certain functions that doesn't bother with import protection?
The current workaround is to simply apply VMP twice in a row which doesn't feel very robust...