Hi Vasco,
You need to measure where the code is spending time with, otherwise it will be guessing. Keep that in mind and use any tool you are familiar with that can get measurements of your execution. I suppose the target here is to measure the latency of each part of your stacktrace over time. A profiler or APM are the best options and we have good open source options for those.
What I would do in your place is attach a profiler on your application while performing the slow actions on the application, and then check the profiler data and tackle specific parts of the code. It is likely the slowness is not on the user interface code, but again, I am guessing now and guessing is no good.
A profiler that provides flame graphs will be visually easier to find out where the time is spent. A few suggestions I have:
- easy option:
https://glowroot.org/ - will be easy enough to configure and attach and check graphs. Explore it if you're not familiar with profilers or APMs.
When you see a big thing on the flamegraph, it should point to which part of the application code it is spending time with. Then you work where the problem really is. I've been using this approach to find production spots that are slow with minimum effort.
Good luck on your profiling!
Cheers
Luiz