Numerical simulation of plant growth has been facing a bottleneck due to the cumbersome computation implied by the complex plant topological structure. In this article, the authors present a new mathematical model for plant growth, GreenLab, overcoming these difficulties. GreenLab is based on a powerful factorization of the plant structure. Fast simulation algorithms are derived for deterministic and stochastic trees. The computation time no longer depends on the number of organs and grows at most quadratically with the age of the plant. This factorization finds applications to build trees very efficiently, in the context of geometric models, and to compute biomass production and distribution, in the context of functional structural models