Are you doing any optimization with your layers similar to what 3D engines do, where only what is visible to the player actually gets sent to be rendered?

I figure if you had an algorithm that would, for each pixel, start at the layer closest to the player and work downward through the layers, doing whatever alpha blending is required, until hitting the first 100% opaque pixel, you would often get away with not considering the bottom-most layers. Then having many layers would become more of a file size issue than a rendering performance issue.

Something related that I learned back when I was making simple 2D engines was that unless something happened in the game which could potentially cause a pixel's color to change, I could save a lot of performance by caching the pixel's color and reusing it, rather than recalculating every pixel every frame.