mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-10 16:50:07 +09:00
9d5ce0752f
With a via grant in the policy, ViaRoutesForPeer still resolved every grant's sources and destinations up front. Non-via grants are only read once a via grant has matched the peer, which is rare (the peer must advertise a covered route), and destinations only for grants whose sources match the viewer. Resolve each grant on first use instead. BenchmarkViaRoutesForPeer, mean per peer (Apple M3 Pro): policy nodes before after via-mixed 100 9.5us 2.1us via-mixed 1000 69.0us 11.6us via 1000 8.1us 8.6us