LuaIRC
LuaIRC copied to clipboard
irc:whois() is unrealisticly slow
Hello!
First thanks for this code, it works really nicely. The problem I have is when I use irc:whois() it takes up to 2 seconds when the user is present and up to 4 seconds when there is no such user. Here my test case, this function is in onchat hook: if (channel == bot.nick and command == "whois") then local userinfo = bot:whois(message:sub(7))['userinfo'] if (userinfo) then local host = userinfo[4] if (host) then sircbot:sendChat(user.nick, host) end else sircbot:sendChat(user.nick, "user not found") end end
The mentioned times are reponse times, between giving the command to the bot and the reply of the bot.
Thanks in advance! Tamás
How many users are in that specific IRC?
You should time irc:whois() Itself rather than timing the bot's response, too, because if you go through IRC, a lot of other factors come into account, including latency, network speeds, other possible people using the bot, etc.
Actually this is a mini IRC server just for the friends, user count is 11, plus some duplications for phones and such. I will try to measure the whois also.