We know that annotation would cause component scan during startup, but would it impact the runtime performance once all configuration loaded?
Btw, we're building a homegrown lightweight restful service framework, to config routing, we got 2 styles:
One of our colleagues has performance concerns about annotation.
Yes, the annotations add a couple of milliseconds at run-time. Once the program is running, however, there will be no additional overhead. Before you optimise, it is always a good idea to run the program to check if performance speed is even an issue - if it ain't broken, don't fix it.
If the program is running too slowly, I would wager that the bottleneck isn't the annotations. To optimise it you should write some benchmarking code to find where the bottleneck actually is and optimise the slowest part. Your colleague would better off saving time by running everywhere and eating his food raw than optimising his annotations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With