This report is related to RT-20405 but I had to create a new one because it does not seem to be possible to attach files to other peoples reports. (Maybe I have just not found it.)
I just could not believe what was stated in the comments of the above mentioned report. So in order to have some comparison I have developed two test programs, one in JavaFX and one in Swing, and have attached them to this report.
Both programs are configured to draw a path which consists of 10_000 lines. With the mouse-wheel you can zoom in and out.
The Swing version starts up and draws the path almost instantaneously. Also zooming is done without any noticeable delay.
The JavaFX version starts up slower and then it takes several seconds until the first path is displayed. Each zoom step also takes several seconds to be completed.
It simply cannot be true that this is supposed to be the substitute for good all AWT/Graphics2D.
But there may be a hint where the actual performance bottleneck is. If I configure the Swing version to NOT limit the scale to values < 1 then I can provoke a similar bad performance in Swing too, when I zoom in so that the path has to be clipped. In order to further examine this I have added another option to use an offset position for the rendering, so that the path has to be clipped even for scale values < 1. But in this case I do not see any performance degradations. This is strange but it might help to track down this problem. Maybe JavaFX is using this unterlying feature which causes this drop in performance all the time and Swing is using it only under certain conditions.