I am doing some profiling of my code and I have noticed that the conversion from Length to Float takes around 12% of the total execution.
% cumulative self self total time seconds seconds calls ms/call ms/call name 35.81 540.04 540.04 901584 0.60 4.45 Array#each 12.46 727.90 187.86 31082436 0.01 0.01 Length#to_f 3.24 1248.25 48.84 31099958 0.00 0.00 Float#to_f
The calculation can run for a few hours so this amount of time can become important.
Now. I know that SU uses inches internally and I have been quite careful (I think) in working only with internal units and exposing the model units only in the UI, but this conversion eludes me.
You can also notice that the number of calls to
Length#to_f is almost exactly identical to
Float#to_f (?) and this makes me suspicious.
I have read the ThomThom guide to units, but I could not find an answer to this.