I have some code that does acl checking; compares an client ip address against a list of addresses (or subnets) that permit or reject. This largely involves iterating across a set of IPAddr objects asking addr.include?(client_addr). Performance is terrible when I include this acl checking.
Why? IPAddr is really slow, so I implemented what I needed as "TubeAddress" and compared the speeds.
implementation | platform | duration | rate
ipaddr | rbx/ 1.8.7 | 18.96 | 2637.29