Hallo, Wesley Smith hat gesagt: // Wesley Smith wrote:
Lua is not really good for doing matrix processing within the script in realtime as it will incur all kinds of overhead. It's best instead to deal with a matrix userdata type with arithmetic metamethod calls defined. This will be really fast and completely dynamic.
Thanks for these hints. I actually had my benchmark wrong as well, and even with floats, Lua was slower than Pd in that case, even sigificantly slower.
However Pd also doesn't use any special matrix ops in the hsv2rgb abstractions. Basically the conversion is just a rather small bunch of additions and multiplications, and still pdlua here was slower. This is similar to [expr] being slower than an explicitly coded Pd patch.
OTOH some benchmarks I did with GL operations in Lua showed Lua to be quite a bit faster than Gem/Pd.
Do you have some further hints where Lua may not be appropriate compared to patching Pd directly?
Ciao