4 ms·
string.find is implemented in C, not Lua. As far as Lua is concerned, that call is a single instruction.
by OskarS 6y ago
string.find is implemented in C, not Lua. As far as Lua is concerned, that call is a single instruction.
- DarkWiiPlayer 6y agoA single instruction that can run for a long time. That's the point.
- pctammela 6y agoditto for eBPF when acessing the C helpers
- dathinab 6y agoYou could have a string.find C implementation which gets an additional budget parameter and depending on it might limit search or similar (and reports back how much "budged" was used) Through always under the assumption that the C function is implemented correctly and adding need to do some explicit budged keeping makes it more complex and in turn more prone to errors.