Try memoizing Interface.interface_ports() with an LFU cache.