Posted on 2009-01-11 16:56:10-08 by pbruncedu
performance hit with different networks
I've got a Linux machine generating OSC messages and a Windows machine that I connect sporadically to its network to receive said messages. The problem is that gethostbyaddr()(called in Server.pm) can be very slow on a LAN without a proper DNS configuration (this little audio network never needed one). The result is completely unacceptable OSC message delivery performance. I'd like to suggest putting something like the following into Server.pm (for when this situation occurs) -- or just put this information where people having performance problems can see it so they can hack out gethostbyaddr() the way I did. The code below becomes very fast after seeing that gethostbyaddr() is slow.
my $fastdns = 1; . . . if ($fastdns) { my $now = time(); ...gethostbyaddr()... if ($now - time() > 2) { $fastdns = 0; } } else { $host = ''; }
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.