3 ms·
I've timed it, it's very slow because it uses reflection to generate the model. The annotation processor doesn't let you avoid this step unfortunately. Native i
by mike_hearn 4y ago
I've timed it, it's very slow because it uses reflection to generate the model. The annotation processor doesn't let you avoid this step unfortunately. Native images do.
- kaba0 4y agoBut that step only has to run as part of building it. It doesn’t have to run at every invocation. How did you try to run it? From the documentation: > The picocli-codegen module includes an annotation processor that can build a model from the picocli annotations at compile time rather than at runtime. > Enabling this annotation processor in your project is optional, but strongly recommended. Use this if you’re interested in I think you didn’t use it.
- mike_hearn 4y agoI use it but you have misunderstood what it does. It builds a model in memory and then you can use that to do other tasks at build time. It doesn't persist the model in a form that the app itself can use to start up faster. See here: https://github.com/remkop/picocli/issues/539 https://github.com/remkop/picocli/issues/539 Although looking over that issue, it looks like maybe reflection was never proven to be the source of the slowdowns.