Revision c16b176d
Added by Dominic Cleal over 7 years ago
modules/dhcp_libvirt/configuration_loader.rb | ||
---|---|---|
def load_dependency_injection_wirings(container, settings)
|
||
container.dependency :memory_store, ::Proxy::MemoryStore
|
||
container.dependency :subnet_service, (lambda do
|
||
::Proxy::DHCP::SubnetService.new(container.get_dependency(:memory_store), container.get_dependency(:memory_store),
|
||
::Proxy::DHCP::SubnetService.new(container.get_dependency(:memory_store),
|
||
container.get_dependency(:memory_store), container.get_dependency(:memory_store),
|
||
container.get_dependency(:memory_store), container.get_dependency(:memory_store))
|
||
end)
|
Also available in: Unified diff
fixes #17387 - SubnetService#find_subnet has constant time lookup
find_subnet is now approximately constant with the number of subnets
configured, using hash lookups of possible network prefixes for the
given IP address until the most specific prefix is found. Benchmark
results:
add_subnet only checks for an identical network prefix instead of
overlapping prefixes with #find_subnet, speeding it up considerably.
Benchmark results: