Phil, Yesterday I started hacking ShapeSpanIterator.c to add stats: the last stage (sort by x0) is the bottleneck. In this case every sort takes up to 15ms per pixel row !
I will see if I can adapt Marlin's MergeSort.java to C to have an efficient sort in-place. Do you know if libawt has already an efficient sort instead of porting mine ? PS: "To save the planet, make software more efficient" is my quote of the day ! Cheers, Laurent Le ven. 12 oct. 2018 à 16:37, Philip Race <philip.r...@oracle.com> a écrit : > If there are no comments in the source, then there is no documentation :-( > Reverse engineering/studying the code is what we'd have to do if that were > the approach to be taken here. > > -phil. > > On 10/12/18, 2:18 AM, Laurent Bourgès wrote: > > Phil, > I looked at the hostpot in > src/java.desktop/share/native/libawt/java2d/pipe/ShapeSpanIterator.c (75% > cpu time) and its sort algorithm looks like an insertion sort ... > If you could give me some explanations (or documentation), I could try > optimizing this method. > > Do you know if it uses an Active Edge Table (AET) or it traverses all > segments every time ? > i.e. segmentTable contains only ACTIVE segments or all ? > >