GNU bug report logs - #21765
24.5; Profiler innefective for recursive functions

Previous Next

Package: emacs;

Reported by: Jonathan H <pythonnut <at> gmail.com>

Date: Mon, 26 Oct 2015 17:48:01 UTC

Severity: normal

Found in version 24.5

To reply to this bug, email your comments to 21765 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21765; Package emacs. (Mon, 26 Oct 2015 17:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan H <pythonnut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 26 Oct 2015 17:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan H <pythonnut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Profiler innefective for recursive functions
Date: Mon, 26 Oct 2015 10:47:01 -0700
[Message part 1 (text/plain, inline)]
The Emacs profiler cannot be used to effectively profile, because the
reports do not flatten the recursion.

Take for example, this recipie:

;; Naive Fibonacci has terrible time complexity.
(defun fib (n)
  (if (< n 3)
      1
    (+ (fib (- n 1))
       (fib (- n 2)))))

(profiler-start 'cpu)
(fib 30)
(profiler-report)
(profiler-stop)

Here, The profiler report assigns (nearly) all of the time to (+ ...),
including time from deeper invocations of fib (and their invocations of (+
...), which makes the profiling report less-than-optimal.

Thanks,
PythonNut
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.