Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

irc:whois() is unrealisticly slow #37

Open
f4th0m opened this issue Jan 23, 2021 · 2 comments
Open

irc:whois() is unrealisticly slow #37

f4th0m opened this issue Jan 23, 2021 · 2 comments

Comments

@f4th0m
Copy link

f4th0m commented Jan 23, 2021

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

@servusdei2018
Copy link

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.

@f4th0m
Copy link
Author

f4th0m commented Apr 26, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants