LuaIRC icon indicating copy to clipboard operation
LuaIRC copied to clipboard

irc:whois() is unrealisticly slow

Open f4th0m opened this issue 4 years ago • 2 comments

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

f4th0m avatar Jan 23 '21 22:01 f4th0m

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.

servusdei2018 avatar Apr 26 '21 00:04 servusdei2018

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.

f4th0m avatar Apr 26 '21 05:04 f4th0m