djbdns
[Top] [All Lists]

Re: djbdns-1.05-epoll + speedup patch

To: djbdns Mailing List <dns@list.cr.yp.to>
Subject: Re: djbdns-1.05-epoll + speedup patch
From: Sami Farin <safari-dns@safari.iki.fi>
Date: Sun, 4 Mar 2007 18:16:57 +0200
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-djbdns@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list dns@list.cr.yp.to
In-reply-to: <20070222162522.GG3982@m.safari.iki.fi>
Mail-followup-to: djbdns Mailing List <dns@list.cr.yp.to>
Mailing-list: contact dns-help@list.cr.yp.to; run by ezmlm
References: <20070116171333.GA5674@m.safari.iki.fi> <20070222122129.GE3982@m.safari.iki.fi> <20070222162522.GG3982@m.safari.iki.fi>
User-agent: Mutt/1.5.14 (2007-02-12)
On Thu, Feb 22, 2007 at 18:25:22 +0200, Sami Farin wrote:
> On Thu, Feb 22, 2007 at 14:21:29 +0200, Sami Farin wrote:
> ...
> > Note that surf() now does 8 loops instead of 16.
> > If someone shows it's easy to crack now, tell me.
> 
> And when doing for PTR queries n.n.n.10.in-addr.arpa
> which all result into NXDOMAIN (queries to localhost):
> 35,678,022  dns_packet.c:dns_packet_getname 
> [/usr/local/src/djbdns-1.05-epoll/dnscache]
> 34,732,154  dns_random.c:dns_random 
> [/usr/local/src/djbdns-1.05-epoll/dnscache]
> 19,614,387  dns_domain.c:dns_domain_free 
> [/usr/local/src/djbdns-1.05-epoll/dnscache]
> ...
> 
> So if you feel courageous, modify surf() to do 4 loops :)

What the heck.

I removed the expensive unconditional divide in dns_random
(used in randombind and in generating of random DNS ID)
and upgraded surf to DJB's ecrypt submission salsa20
(with 8 iterations instead of 20).
Also, it returns uint16 instead of unsigned int.
It's now ~ten times faster than the original.

Also, 16 expensive divides were optimized out of query.c:doit()
by inlining and optimizing dns_sortip().
Make sure your version does not have "div" or equivalent insn
in query.s after doing "gcc -S query.c".

-- 

Attachment: djbdns-1.05-epoll-20070222T160840Z-20070304T144118Z.diff
Description: Text document

Attachment: pgpfJCvjLe9Sd.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>