baudehlo/Haraka — pull request #595 by msimerson (2014-05-28 21:59:59+00:00)
Title: host_list: huge performance increase, esp for many hosts

Before I defecate on the implementation of rcpt_to.in_host_list, allow me to first point out the one area where it excels:

loaded 90822 hosts
loading config took 0.066 seconds (array)
loading config took 0.087 seconds (array+toLowerCase())
loading config took 0.152 seconds (object+toLowerCase())

That's right, the existing implementation is fastest as loading the config file to an array. But it's all downhill from there. In the next test, we look up every hostname in the list one time (90,822 iterations, to average the lookup time):

searching config took 1662.722 seconds (array)
searching config took 87.560 seconds (array (lc during load))
searching config took 0.208 seconds (object (lc during load))