Just reporting a little benchmark I did with MP's program.
When testing a list to know if a point is present in it,
we may use the following.
The point list was 5000 pts long and we are searching for the 4800th point:
(setq p (nth 4800 pl))
(4783.64 2541.82 128.687)
_$ (benchmark '((vl-position p pl) (member p pl)))
Benchmarking ................Elapsed milliseconds / relative speed for 8192 iteration(s):
(VL-POSITION P PL).....1232 / 3.56 <fastest>
(MEMBER P PL)..........4384 / 1.00 <slowest>
_$
_$ (benchmark '((vl-position p pl) (member p pl)))
Benchmarking ................Elapsed milliseconds / relative speed for 8192 iteration(s):
(VL-POSITION P PL).....1217 / 3.58 <fastest>
(MEMBER P PL)..........4352 / 1.00 <slowest>
I remember testing it before and my conclusion then
was that vl-position was marginally faster.
So I am bit surprised to see that on this length of
list, it is actually about 3.6 times faster.
ymg