Accessing otbObject's parameters property is slow
With the actual implementation and latest changes in 1.5, we have to call app.GetParameters() and create a new dict each time parameters are accessed.
Instead we can simply access a simple attribute, which can be updated just after setting parameters so we keep it in sync with otbApplication instance's parameters.
For otbObjects other than apps, we just declare a reference to its pyotb_app parameters dict.
This result in 3000x speedup when accessing app.parameters. Since this dict is frequently accessed, this make a quite a diff in app init time and affects pipelines performance.
# Property
In [3]: %timeit inp.parameters
319 µs ± 3.05 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
# Attribute
In [3]: %timeit inp.parameters
55 ns ± 1.31 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)
Edited by Cresson Remi