Hello.
I have a function that returns list of fit points of a spline:
(DEFUN _getPoints
(ent
/ coord result
) )
)
)
I use it also to count fit points, which seemed like waste of resources, since I could just count the point within the function instead:
(DEFUN _getNumPoints
(ent
/ coord num
) )
)
)
However, my benchmark shows that
_getNumPoints is actually slower, almost twice on spline with 200+ points!
How is this possible? Or my benchmark is incorrect?
(defun c:test
(/ ent _getPoints _isNumPoints test test1 test2
) (DEFUN _getPoints
(ent
/ coord result
) )
)
)
(DEFUN _getNumPoints
(ent
/ coord num
) )
)
)
; only FIT spline, not CV
; start bench
(repeat 100 (_getNumPoints ent
) ) ;
(repeat 100 (_getPoints ent
) ) ; result
(princ "\n_getNumPoints: ") )
P.S.
While preparing this question, I've noticed that if I preselect spline before running the test it takes 10 times longer than when spline selected when prompted by the test...huh?
Command: TEST <--- pre selected spline
_getNumPoints: 1030
_getPoints: 542
Command:
Command: TEST <-- nothing pre selected
Select objects:
_getNumPoints: 68
_getPoints: 37