The most efficient algorithm for computing cardinality of sumset
Use the FFT.  The characteristic vector of $A+B$ is the convolution of the characteristic vectors for $A$ and for $B$.  Convolutions can be computed efficiently using a FFT.  As long as every element of $A,B$ is not too large, this will be efficient: the running time will be approximately $O(n \lg n)$ if $A,B \subseteq \{1,2,\dots,n\}$.