Oi! Given https://github.com/freenet/fred/blob/next/src/freenet/node/PeerManager.java#L1049
We seem to get our peers location and their peer's location... Iterate over the whole lot (150^2 entries max) ... And then for each of them, ensure that they haven't been routed to before by iterating over a list of locations we've already routed to (18 is the max HTL) ... That's 18*150^2 => 405k iterations in the worst case ... on the hot-path (each request we route will go through it)! It seems very naive. How can we do better? Locations are double, what's the best data-structure here? I'm rusty: is a TreeMap with a custom comparator (NavigableMap) what we want? Florent PS: we caught a thread dump with 15 threads crunching through that specific code path today! http://fpaste.org/277703/44497924/ http://fpaste.org/277704/49794514/ _______________________________________________ Devl mailing list Devl@freenetproject.org https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl