2 ms·
> PicoCLI for argument parsing is one Doesn’t it generate every additional code at compile time? I didn’t notice it slowing down my startup times, it’s mostly
by kaba0 4y ago
> PicoCLI for argument parsing is one
Doesn’t it generate every additional code at compile time? I didn’t notice it slowing down my startup times, it’s mostly every other lib (which you usually have, as what’s the point of a hello world cli app)
- mike_hearn 4y agoI'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.