Closed ecurtiss closed 1 year ago
In the following code, the 2 * self.b, 3 * self.a, and 6 * self.a can be cached. This is particularly important for :SolveVelocity(), which is used heavily for arc length reparametrization. https://github.com/EthanCurtiss/CatRom/blob/5a1c066d23dc660f4733e6ac10d1022cf24c7852/src/Spline.lua#L105-L113
2 * self.b
3 * self.a
6 * self.a
This (red bar) turns out to not be faster than the original (green bar). The other two benchmarks are unrelated to this issue.
In the following code, the
2 * self.b
,3 * self.a
, and6 * self.a
can be cached. This is particularly important for :SolveVelocity(), which is used heavily for arc length reparametrization. https://github.com/EthanCurtiss/CatRom/blob/5a1c066d23dc660f4733e6ac10d1022cf24c7852/src/Spline.lua#L105-L113