From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: What does all-completions with COLLECTION == obarray return? Date: Sat, 04 Apr 2015 18:43:10 +0200 Message-ID: <87k2xr7skh.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1428165817 29675 80.91.229.3 (4 Apr 2015 16:43:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Apr 2015 16:43:37 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 04 18:43:31 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YeRAP-0002ef-QE for ged-emacs-devel@m.gmane.org; Sat, 04 Apr 2015 18:43:29 +0200 Original-Received: from localhost ([::1]:33768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeRAP-0001fA-8a for ged-emacs-devel@m.gmane.org; Sat, 04 Apr 2015 12:43:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeRAD-0001eq-Ju for emacs-devel@gnu.org; Sat, 04 Apr 2015 12:43:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeRAA-00051x-8R for emacs-devel@gnu.org; Sat, 04 Apr 2015 12:43:17 -0400 Original-Received: from mout.web.de ([212.227.17.12]:57307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeRA9-00050t-W2 for emacs-devel@gnu.org; Sat, 04 Apr 2015 12:43:14 -0400 Original-Received: from drachen.dragon ([188.99.173.105]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MJTdf-1YhTQi1f1n-00399Q; Sat, 04 Apr 2015 18:43:11 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:Fsaa3PE+nOCljFgg+HawrRW9tdV6vqST5GR8XYBhA65Nmi0haNc lj+vx3Orasr4Yt/T4cRFiBWXuco8Bn394uXT/Egg/m7Cy7wHdg3GipyAz6xO3dTfNaOosQe nl59y7cVHwqFKeAluVAjT3gWzrErVwQvNGy+IK+ILsQoWCo5la7tP/kxMtIzncoREkd52Q/ SrYsknXb7MY8P9xbwCHKw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184881 Archived-At: Hello, in emacs -Q, (cons (length obarray) (length (all-completions "" obarray))) ==> (1511 . 15039) I don't understand why the second value is so much larger than the first. I would expect as many completions as interned symbols. Some background: In helm, we've found a really weird bug. If you repeatedly evaluate, with helm-mode on, the following: --8<---------------cut here---------------start------------->8--- (let* ((hi-lock-face-defaults (list "hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb"))) (completing-read (format "Highlight using face (default %s): " (car hi-lock-face-defaults)) (all-completions "" obarray) 'facep t nil 'face-name-history hi-lock-face-defaults)) --8<---------------cut here---------------end--------------->8--- (just say C-g at each prompt), after ten or so iterations, it gets slow, every time it takes twice as long as before until the prompt appears. Soon it gets completely unusable freezing Emacs for a minute. I debugged this and found out that after performing this test, (all-completions "" obarray) does return a list with ~ a million elements. Since we use all-completions to create a candidate list for completion, we have a million candidates then, and this is what makes Helm slow. (length (all-completions "" obarray)) seems to grow exponentially for every iteration of the above code, but obarray remains constant in size. What could be happening here? Thanks, Michael.