Would there be any performance boost from using one of the function. Is there a internal difference from using these two function, if so what are they.
Asked
Active
Viewed 717 times
1 Answers
2
dofile
, loadfile
and loadstring
all call the same primitive to parse scripts.
I assume you mean loadstring(file:read("*a"))
. In this case, there may be a small performance hit (which I haven't measured) because Lua has to store the whole contents of the file as a string. The primitive that parses scripts does not do that: it reads the input in pieces.

lhf
- 70,581
- 9
- 108
- 149
-
Can you please get more technical – Mar 13 '20 at 00:52