Update of /project/cl-utilities/cvsroot/cl-utilities/doc In directory clnet:/tmp/cvs-serv24065/doc
Modified Files: split-sequence.html Log Message: Added implementation notes explaining the abysmal performance on lists.
--- /project/cl-utilities/cvsroot/cl-utilities/doc/split-sequence.html 2006/05/03 01:33:28 1.3 +++ /project/cl-utilities/cvsroot/cl-utilities/doc/split-sequence.html 2006/05/03 01:46:54 1.4 @@ -78,11 +78,28 @@ me</a> so we can get it straightened out.</p>
<p>The implementation itself is mature and well tested, and it is -widely used. Efficiency probably isn't what it could be with some type -declarations, but the code is striaghtforward and should be fast -enough. If it isn't fast enough for <i>you</i>, feel free to modify -it, or even just complain about it on the mailing list---something -might get done.</p> +widely used. The code should be fast enough for most people, but be +warned: it was written with vectors in mind, with list manipulation as +an afterthought. It does a lot of things that are quick on vectors but +slow on lists, and this can result in many orders of magnitude +slowdown in list benchmarks versus code written for lists. If this is +a problem for you, it should be straightforward to write your own, +such as the (more limited, not API compatible) example function given +by Szymon in <a +href="http://common-lisp.net/pipermail/cl-utilities-devel/2006-May/000011.html%22%... +mailing list post</a>:</p> + +<p><pre> +(defun split-list-if (test list &aux (start list) (end list)) + (loop while (and end (setq start (member-if-not test end))) + collect (ldiff start (setq end (member-if test start))))) +</pre></p> + +<p>If this is an issue for enough people, I could optimize the code +and fix this problem. I'm reluctant to do that, however, since the +code works and is tested. It's usually more important to be correct +and non-buggy than to be fast, and I have been known to introduce +bugs.</p>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
cl-utilities-cvs@common-lisp.net