From 0f0f6ddbb97716de7af9a5bbd4519c0ec4e53b95 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 21 Aug 2020 22:35:57 +0200 Subject: [PATCH] netns: add comment about undesirable algorithmic complexity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't want to be Accidentally Quadraticâ„¢ --- modules/netns-isolation.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index e51d89e..050e183 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -16,6 +16,12 @@ let # availableNetns.bitcoind = [ "clighting" ]; # and # availableNetns.clighting = [ "bitcoind" ]; + # + # FIXME: Although negligible for our purposes, this calculation's runtime + # is in the order of (number of connections * number of services), + # because attrsets and lists are fully copied on each update with '//' or '++'. + # This can only be improved with an update in the nix language. + # availableNetns = let # base = { clightning = [ "bitcoind" ]; ... } base = builtins.mapAttrs (n: v: