From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Charlie Andrews Newsgroups: gmane.emacs.help Subject: profiler-report seems to be missing data? Date: Wed, 15 Aug 2018 11:00:50 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1534346208 25950 195.159.176.226 (15 Aug 2018 15:16:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Aug 2018 15:16:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 15 17:16:44 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fpxXQ-0006eY-3c for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Aug 2018 17:16:44 +0200 Original-Received: from localhost ([::1]:50142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpxZW-0005oQ-Kq for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Aug 2018 11:18:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpxJ3-0006dU-9z for help-gnu-emacs@gnu.org; Wed, 15 Aug 2018 11:02:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpxIb-0001aQ-Nq for help-gnu-emacs@gnu.org; Wed, 15 Aug 2018 11:01:50 -0400 Original-Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]:40032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpxIY-0001U4-D3 for help-gnu-emacs@gnu.org; Wed, 15 Aug 2018 11:01:25 -0400 Original-Received: by mail-it0-x229.google.com with SMTP id h23-v6so2281246ita.5 for ; Wed, 15 Aug 2018 08:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=gUZQLD5+DqEW7+7hE2+qsVambHPS3DQQkp28SBtAeuk=; b=eWO+nVHtsAZwxha5wzZSt2Xzp1fbqnutEq3nt9QR5iUSjG3Lv84YQySqOk4mfGgBk0 NVTU3XQTjfJiHK5yeqXql3/NzKRbvIRhWxCJoH0XkNvxp88M4iF3rMQUP9P4XbEU62im CyhZtZOHdvLKRuFeDXMHaggRF38evqkVl2nmxw2Pda1LnbVoFd2+V/kUYdbiBXwBjfyS pTEltCTjh8xXXvRXSuSocUxMTSwEiy93tEvpLkmQuWD4nTRQrFIHYiZBKIiVEj5uppQk yHh2QrISDWPxGQi0wy2q7OOyjbVEDQJGB/KT/mshuXIBcjMMGMyXIepyMh9PkBUv7C+2 jlOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gUZQLD5+DqEW7+7hE2+qsVambHPS3DQQkp28SBtAeuk=; b=JpV2QWzGdutIA4imSQepr78shPQvpsrXBoBQ8NRAA2cX3XoMzF9LxB3sn85Slf+7l0 ivnWl0tgpsXLAEOEsZcbc3xF3tjV04XNi2FBWo1OsfyuPS1HiFpd5zNSkre1W3eVlY7B 9z6f53+ecawBMcsrC4ELQ3EiXKgCSZwkOd2fLbMnFrM9Av0FRkQ8TQpIjpwGesODXfi6 aSg9EY8idchD65vzPJjF4hjiYnYzd0Y6f0FNjBoc3LVlFcEcuATKpJGw8ysIxYIdTLQk UZukgo8Ew5YcxYPcb+8kPn/ekJV2kdJrnoCveI/3JUQRTuHAmOoXf+nuYfDE5g0Tdj3c QyWw== X-Gm-Message-State: AOUpUlENCC4s+1HDxKN4Icq8caiWM/TDskk/chso0rLAKio7WIBWY7/A P3vDXYLIF62eBvm2IStrsDXXUQhNAwu61H8WxiSjdegl X-Google-Smtp-Source: AA+uWPwC2GEahW+X5UfLm8lwEifoHJRSiz2pcCWBz1rywHHPyJfyXaZldeRinutjxbZLWIMKFQJZ6jWHVGJW3DWfHqs= X-Received: by 2002:a24:e47:: with SMTP id 68-v6mr17579696ite.23.1534345261407; Wed, 15 Aug 2018 08:01:01 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::229 X-Mailman-Approved-At: Wed, 15 Aug 2018 11:17:48 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117662 Archived-At: I'm trying to profile the usually excellent `find-things-fast` package to figure out why it's slow in my project. I started profiling with `profiler-start`, executed the command that's slow (`ftf-find-file`), then immediately ran `profiler-report`. This generated the following report: Functions CPU samples % - command-execute 1770 88% - call-interactively 1770 88% - apply 1770 88% - call-interactively@ido-cr+-record-current-command 1770 88% - apply 1770 88% - # 1770 88% - funcall-interactively 1770 88% - ftf-find-file 1597 80% - ftf-project-files-alist 1522 76% - ftf-project-files-hash 1330 66% - let 1330 66% - mapcar 1330 66% - # 1024 51% - let* 1008 50% cons 24 1% + split-string 282 14% + maphash 192 9% + ido-completing-read 67 3% + next-line 75 3% + ido-switch-buffer 41 2% + ido-switch-buffer-other-window 38 1% + profiler-report 19 0% + ... 145 7% + redisplay_internal (C function) 37 1% + timer-event-handler 26 1% undefined 5 0% + gui-set-selection 4 0% internal-echo-keystrokes-prefix 2 0% The profiler report seems to blame the `let*` function within `ftf-project-files-hash`. However, looking at that function: (defun ftf-project-files-hash () "Returns a hashtable filled with file names as the key and " (let ((default-directory (ftf-project-directory)) (table (make-hash-table :test 'equal))) (mapcar (lambda (file) (let* ((file-name (file-name-nondirectory file)) (full-path (expand-file-name file)) (pathlist (cons full-path (gethash file-name table nil)))) (puthash file-name pathlist table))) (split-string (ftf-project-files-string))) table)) It seems incredibly unlikely that `let*` is the slow part, but rather one of the functions called within that `let*`. Why is `profiler-report` stopping at `let*` rather than telling me which component of that `let*` is slow? How can I dig deeper to find which exactly function is slow? (FWIW, I've tried increasing profiler-max-stack-depth from 16 to 30 to no avail.)