I’m not sure where or when I heard this but I remember being told that a roof and/or walls around any spawning-type farm will increase rates as it encourages “pack spawning”.

Any technically-minded Minecraft peeps out there able to weigh in on this and if it’s still a game mechanic?