Significant performance improvement of `alpha_composite` function.