On the topic of CPU usage, I wrote a long post wondering about multithreading, then found the wiki page for it here on the site at love.thread.
I am also wondering: what makes pairs() so slow? Is it something to do with C hash tables under the hood?
Love CPU usage
Re: Love CPU usage
It's NYI. http://wiki.luajit.org/NYI
There's been some effort by a third party to implement next(), but not sure it has been contributed back. https://blog.cloudflare.com/luajit-hack ... -nyi-list/ . The post also mentions that next() is only part of the story, as LuaJIT is using an optimization that makes interpreted pairs() on par, or even faster, than compiled next(). Regardless, since it breaks traces, the code within a pairs() loop is generally slow, even if the pairs() part of the loop itself may be faster.
(The post gives a lot of insight into LuaJIT's internals, and it's worth a read if you're interested in optimizing your LJ projects)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 1 guest