I am having an issue running a junit test in netbeans 8.2. When simply run, it is something like 10x faster than when debugged. Both are done inside netbeans IDE. For example, a snippet of code to access CosmosDB using the MongoDB API:
MongoClientOptions.Builder builder = MongoClientOptions.builder();
builder.sslEnabled(mongodbSsl);
Will take about 20 seconds and consume a full CPU core while doing so. If I run with -verbose, I see 570 lines of classloader output during the second line of code, but that doesn't strike me as something that should take 20 seconds, nor does it explain the in-debugger time difference. Could it be exceptions caught-and-ignored hitting the IDE? Is there a way to get extra output explaining where the time is going? Unfortunately I don't know how to debug and profile at the same time.
Update: this issue does not occur in Eclipse.