Layout system optimizations

Computing size for labels is the most time consuming part of the layout system.
We use some metrics to predict wether or not the size should be computed using the last size computed and the new bounding box so that we can know if computing the size is required or not.