When I run code inside NetBeans it is very slow. However, when I convert the code to a standalone application it runs 5 times faster. That is awkward because it won't let me test it as it will truly run on a mac. I'm using netbeans 8.
The application involves heavy memory usage. I think maybe, just maybe, netbeans is limiting the size of the heap. Anyway passed the -Xmx2048m
flag to the program.
clue: when I build the software to an .app file, then go inside that app package and edit the .plist file, I manually add the line2:
<key>VMOptions</key>
<string>-Xmx1024m</string>
and that's the only way to make it run fast as I would like. And that is only as standalone, outside netbeans.