Envoy config sync strategy

Hi, can someone help me understand how isto does it?

When envoy sidecar in a pod has to know about all the ports and their protocol via xds, how istiod generates that information and and sync every change in namespace instantly.

I came up with maintaining internal state in structs, from responses from endpoints informer, but this will break HPA, and utilizing a lot of memory for keeping envoy snapshot and config for a 1000 pods.