[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: data structure lockin



Continuing the topic of data structures, I noticed a slowdown for the DNS 
performance after the recent conversion to cstruct.  While the memoized version 
(which caches marshalled packets) was about the same performance, the normal 
one was much slower (even worse than BIND).

Thomas did some profiling today, and it turns out that the use of a mutable 
Hashtbl for tracking label compression results in very bad performance, since 
the string lists all have hash collisions and ends up linearising the 
structure.  He converted it to use a purely functional Map instead (which just 
lives on the minor heap since it's only needed for one packet parse cycle), and 
performance is right back where it should be!

https://github.com/samoht/ocaml-dns/commit/fd68be3850353f2fb981b100bf04562ae0d99a1e

(mainly fyi for Mort, but useful for others too)

-anil


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.