Integration of exchange and correlation (XC) interaction has to be done numerically since the various functionals - and their derivatives - describing the interaction are too complex to evaluate analytically. There are a number of items that has to be implemented efficiently to quickly compute the interaction in question:
Traditionally, the grid for XC integration has been generated by combining accurate spherical grids generated for each atom separately. Simple algorithms checks overlap between all atom grids which becomes time consuming for large molecules and has to be avoided.
There exists also methods that generate hierarchical multiscale cartesian grids that are competitive with traditional approaches under certain circumstances.
Since the gaussian basis set is local, only some basis functions are non-zero at any given grid point. This means that only a fixed, constant amount of work is done for each point - provided one knows in advance which functions are these.