On Wed, 18 Nov 2015, Nathann Cohen wrote:

In some cases, however, the users call functions without knowing (subfunction of other things), or just won't look at the doc, or just won't even profile the code (not everybody knows how) and 'just wait'.

True. But I can see no easy way to do it. There should be something like

foo(n):
    . . .
    if n>100:
        add_note('foo() may be faster if you install bar-library.')

and then notebook would check if computation took more than one minute and if so, print

"Note: The computation took more than a minute. However, we have suggestions that may help:

- foo() may be faster if you install bar-library.
- . . .

[ OK ] [ Do not show this hint anymore ] [ Disable all hints ]"

But even then the user could be confused if it was actually xyzzy() that called foo(). So add_note() should take a stack trace.

 * * *

And this sounds complicated. And there are many places where this will not help: use sparse matrix, have %cython etc.

--
Jori Mäntysalo

Reply via email to