On Mon, Jun 15, 2020 at 9:06 AM Anuj Verma <an...@iitbhilai.ac.in> wrote: > > > Your profiling results indicate that a lot of time is spent > > calculating distances. Perhaps, you can work with much faster > > square-distances (they can be signed or signs stored separately) and > > apply square root as a final processing step. Or, would signed > > square-distance field work as well (SSDF so to speak)? Please spend > > some time thinking about optimizations and bottlenecks. > > Yes, even I was thinking of reducing the number of calls to > `ft_trig_pseudo_polarize' > which I believe is called through `FT_Vector_Length'. Working with squared > distances > can definitely be a good option, it will cut the total time by almost 50%.
For linear segments, it will save more than 90% according to your table. Then you will see that splitting Bezier curves is not such a bad option. In general, Bezier curves are used in graphics because it is easy to split and flatten them. I would be very surprised if distance fields were different in this regard? Alexei