Hrvoje Niksic <hniksic(a)srce.hr> writes:
string-lessp uses string_char() to access individual charactrs, even
under Mule where that operation is O(n). This makes string comparison
O(n^2), potentially very slow for large strings.
This is not noticable with short strings, but is catastrophic with
longer ones (and I can only guess what it does to sorting). To test
the slowness of comparing long strings, try this (under Mule):
(setq s1 (make-string 10000 ?a)) <C-x C-e>
(setq s2 (make-string 10000 ?a)) <C-x C-e>
(string-lessp s1 s2)
With this patch the comparison becomes instantaneous:
1999-06-04 Hrvoje Niksic <hniksic(a)srce.hr>
* fns.c (Fstring_lessp): Remove O(n^2) under Mule.
Something funny started happenning with `func-menu' function
listings so...
(string-lessp "abcd" "abce")
==> nil
???
--
Mike.