On 20/02/13 12:57, Jason A. Donenfeld wrote: > Hi Simon & Folks, > > Currently when dnsmasq processes server=/.../, address=/.../, > local=/.../, ipset=/.../, and similar, it find the nearest match for a > domain name by iterating through all the keys, and keeping track of > which one had the largest match length. This gets the job done and is > fairly, simple. But it also could be optimized quite a bit. > > This might be a bit verbose for dnsmasq's tastes, and maybe the notion > smells a bit too much of "My First Computer Science Data Structure" kind > of thing, but perhaps this might be a welcome optimization. I present > you with domain-lookup-tree, a simple set of C functions that store > domain names in a tree structure: > > http://git.zx2c4.com/domain-lookup-tree/about/ > > It should be relatively straightforward. I wrote it specifically with > dnsmasq in mind, so if you're interested, I'd be thrilled to see it > replace the current nieve matching technique. > > Thoughts? Comments? Ideas? >
I've not had time to look at you code yet, but it's worth pointing out that the code you're trying to replace is very old and very gnarly, and very high up the list of "stuff that should be re-written". I'm currently snowed under (at least partially with your earlier good work) so I may not get to this for a while. This email at least puts down a marker that I want to look at it, and if I don't get back to it in few weeks, please remind me. Cheers, Simon. > Jason > > > _______________________________________________ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > _______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss