We report the screening of low-energy crystal structures of CsPbBr3 and RbPbBr3 from approximately 740 structural prototypes using high-flux density functional theory (DFT). These structures are well compared in terms of thermodynamics, band structures and optical properties. Calculated phonon spectra and Gibbs free energy indicate that the Pbnm structure possesses the best kinetic and thermodynamic stability. Band-structure calculations reveal that many CsPbBr3 and RbPbBr3 structures have direct band gap. Optical calculations show a positive correlation between the band gap and photon energy. The structures with low band gap have faster light response, while structures having wider band gap exhibit better optical properties because of their higher photon energies.