emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: remove-duplicates performances


From: Ted Zlatanov
Subject: Re: remove-duplicates performances
Date: Fri, 20 May 2011 10:16:02 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

On Fri, 20 May 2011 11:09:55 -0300 Stefan Monnier <address@hidden> wrote: 

>> i just noticed that `remove-duplicates' is very slow.
SM> It's using an O(N²) algorithm, so it's indeed slow for long lists.
...
SM> For such long lists, I fully expect it to be slow.
SM> But for short lists, the overhead of constructing a hash-table should
SM> make the current code competitive.  Can you try and find out for which
SM> lengths your code is better than the one we have?

That would depend on the memory and CPU available to Emacs, wouldn't it?
Plus small data sets will have a lot of performance variance due to
external factors.  I would just make 30 the breaking point.

Ted




reply via email to

[Prev in Thread] Current Thread [Next in Thread]