i explained it in this post https://www.theswamp.org/index.php?topic=19128.msg288827#msg288827
You are right !
I made these the following 2 tests only with your function :
vk_RemoveDupl and
vk_RemoveDupl_2 (where I have
removed vl-position)
. . .
(InList / OutList First)
OutList
(cons First OutList
) )
)
)
)
. . . . .
(InList / OutList First)
OutList
(cons First OutList
) )
)
)
(setq mylst nil i 0)
(repeat 1000 (setq mylst (cons (setq i (1+ i)) mylst)))
---------------------------------------------------------------------
(benchmark '((vk_RemoveDupl mylst) (vk_RemoveDupl_2 mylst)))
Elapsed milliseconds for 80 iteration(s)/ relative Timing :
(VK_REMOVEDUPL_2 MYLST).....
5039 / 20.1560 <slowest>(VK_REMOVEDUPL MYLST)........
250 / 1.0000 <fastest>---------------------------------------------------------------------
(setq mylst (append mylst mylst mylst mylst mylst mylst ) )
(benchmark '((vk_RemoveDupl mylst) (vk_RemoveDupl_2 mylst)))
(now mylst
contains duplicates . . .)
Elapsed milliseconds for 5 iteration(s)/ relative Timing :
(VK_REMOVEDUPL MYLST).......1794 /
1.0176 <slowest>
(VK_REMOVEDUPL_2 MYLST).....1763 /
1.0000 <fastest>
---------------------------------------------------------------------
So
the result depends from the "type" of the list ...
... and because
vl-position finds
only the first position while
vl-remove, before removing something, has to find
all the positions. . .
VovKa, You are always right !