This paper addresses the lack of attention paid by the scientific community to the optimization of timber structures, specifically in the context of large-span agro-industrial constructions. The study focuses on the optimization of a three-dimensional roof composed of GL32h glulam regular double-tapered beams and purlins. Firstly, MATLAB was employed to develop a calculation software and then run the proposed optimization model based on genetic algorithms, in order to optimize the different geometries of the construction elements based on cost, as well as the optimum arrangement of the purlins and the number of beams. Moreover, statistical analyses were carried out on more than 200 optimization data points to uncover the influence of different variables in the optimization process. It was found that the snow load and span have a significant influence on the prediction of the height and width of beams and purlins, as well as the purlin spacing; while, as expected, the roof length also influences the optimal number of beams. All these findings could promote the use of timber structures; thus, achieving more sustainable and efficient construction practices.