Opened 6 years ago

Closed 6 years ago

#16038 closed enhancement (fixed)

C function profiler

Reported by: vbraun Owned by:
Priority: major Milestone: sage-6.2
Component: performance Keywords:
Cc: Merged in:
Authors: Volker Braun Reviewers: Nathann Cohen
Report Upstream: N/A Work issues:
Branch: 29db6cd (Commits) Commit: 29db6cd46bce1751011613a6b4d99eb47656b6d0
Dependencies: Stopgaps:

Description

This ticket complements the %prun magic for Python profiler with a %crun magic that given C function profile information using gperftools (optional, expected to be provided by the OS).

Change History (15)

comment:1 Changed 6 years ago by vbraun

  • Branch set to u/vbraun/c_profiler

comment:2 Changed 6 years ago by ncohen

  • Commit set to 8dd0d7dac47688c398b3e837d42751aecff3ced4

(DEAD curious)


New commits:

86fe787fix sage -gdb
234b6c9Do not import prun, it is provided by IPython
8dd0d7dinitial implementation of a gperftools profiler interface

comment:3 Changed 6 years ago by git

  • Commit changed from 8dd0d7dac47688c398b3e837d42751aecff3ced4 to 3f98bd01c2399b2633efb75e3d554195095df915

Branch pushed to git repo; I updated commit sha1. New commits:

3f98bd0seach for alternatively-named pprof binaries

comment:4 Changed 6 years ago by ncohen

  • Status changed from new to needs_info

Helloooooooooo !!!

It would be cool to have an explicit error message when there is no output due to this 10ms thing. Could you also add this new file to the reference manual ?

By the way, what it this :param s:/:type s: ? I never saw them before. Could you wrap that in a "INPUT" block btw (the two crun functions need one) ?

Also : the gif output is cool but would there be a way to make it available through %crun directly ? Or at least crun("cmd") ?

There is also an unfinished sentence in the doc :

By default, a if 

Nathann

(super nice tool !)

comment:5 Changed 6 years ago by git

  • Commit changed from 3f98bd01c2399b2633efb75e3d554195095df915 to acebf369954b89a6c21e9324b4c7dbae5c009e9c

Branch pushed to git repo; I updated commit sha1. New commits:

f8513e7improve documentation
1f045f7add the Sage IPython extension to the manual
acebf36warn if profiled command finishes < 100ms

comment:6 follow-up: Changed 6 years ago by vbraun

  • Status changed from needs_info to needs_review

Done.

The :param is standard Python syntax which we don't use in Sage. I changed it to our conventions.

comment:7 in reply to: ↑ 6 Changed 6 years ago by ncohen

  • Status changed from needs_review to positive_review

Yoooooooooooo !

Done.

Thanks ! And we'll add this .gif output some later day if we need it :-)

Nathann

P.S. : By the way, why didn't you raise an exception when the program runs <100ms ?

comment:8 Changed 6 years ago by ncohen

  • Reviewers set to Nathann Cohen

comment:9 Changed 6 years ago by vbraun

Its not really an error, maybe you know what you are doing. The user might have changed the sampling frequency, for example.

comment:10 Changed 6 years ago by git

  • Commit changed from acebf369954b89a6c21e9324b4c7dbae5c009e9c to 1569bafefd2cbedabe723d5cb37db04c200e72cc
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

1569bafdoctest failure if pperf is not installed

comment:11 Changed 6 years ago by ncohen

Ahahah. Is that for sage -coverage ? :-P

Nathann

comment:12 Changed 6 years ago by vbraun

No, # random output still fails if there is an exception raised...

comment:13 Changed 6 years ago by ncohen

  • Status changed from needs_review to positive_review

oops, right !

Passes all tests, with/without gperftools installed. Good to go again.

Nathann

comment:14 Changed 6 years ago by git

  • Commit changed from 1569bafefd2cbedabe723d5cb37db04c200e72cc to 29db6cd46bce1751011613a6b4d99eb47656b6d0
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

29db6cdOSX fix

comment:15 Changed 6 years ago by vbraun

  • Branch changed from u/vbraun/c_profiler to 29db6cd46bce1751011613a6b4d99eb47656b6d0
  • Resolution set to fixed
  • Status changed from needs_review to closed
Note: See TracTickets for help on using tickets.