![netbeans profiling netbeans profiling](https://i.stack.imgur.com/n0gRz.png)
Netbeans profiling generator#
(For more, see Using a Load Generator in NetBeans IDE.) The caching capabilities of various browsers can also have an impact on performance. You can use a load generators to help you with this.
Netbeans profiling code#
To obtain profiling data that better represents real application performance, you should generate some workload on the profiled code before measuring any times (call trees should not be affected by this). Also, the behavior of servlets and other application code can be slightly different during the first run than it is in a real production environment, where the application is running constantly. If a JSP page is being displayed for the first time, it is compiled to the servlet internally by the server, which affects the call tree and the methods timing. You should note that the data collected when the application starts up the first time often only represents the startup behavior of the web application. The first usable data will be collected after some code is invoked as a result of some action in the web browser, typically displaying a JSP page that uses JavaBeans and/or custom tags or processing servlet’s doGet / doPost method. Usually you are not interested in data about listeners or filters, so you can click Reset Collected Results to clear that data. If you specify some profiling root methods you probably will not get this data, depending on the root methods that you select.
![netbeans profiling netbeans profiling](https://4.bp.blogspot.com/_fNtFXU_t3Yc/S-DQnAGthgI/AAAAAAAACZw/WrND-elOQ30/s1600/1_overview_25.jpg)
If you are using the Advanced method and you do not specify any profiling root methods, some interesting data is available immediately after server startup, specifically the web application’s listeners and filters initialization. Profiling results are collected as soon as the profiling session is started. It is recommended that you use the Profile only project classes filter when profiling enterprise applications. For this reason it is important to choose a filter to limit the sources that are instrumented. In addition to the Java core classes, an enterprise application will typically invoke a number of methods in classes in the target server.