You’re actually supposed to avoid this. The reason it’s in the sample is because they rushed it (i.e. they didn’t optimize like they would for a final game). Nonetheless, it was performant enough, so they kept it.
It’s also talked about in the docs at Closely Stacked Surfaces.