The instanciation number of transformer factory can be optimized using the transformer factory defined as thread local in the petals-common project.