yappi /

Filename Size Date modified Message
tests
33.7 KB
50 B
2.1 KB
337 B
1.0 KB
11 B
2.1 KB
535 B
34.2 KB
2.4 KB
521 B
836 B
1.6 KB
322 B
3.2 KB
1.0 KB
1.9 KB
301 B
1.2 KB
1000 B
123 B
1.1 KB
2.9 KB

Yappi

Motivation:

CPython standart distribution is coming with three profilers. cProfile, Profile and hotshot. cProfile module is implemented as a C module based on lsprof, Profile is in pure Python and the hotshot can be seen as a small subset of a cProfile. The motivation to implement a new profiler is that all of these profilers lacks the support of multi-threaded programs. If you want to profile a multi-threaded application, you must give an entry point to these profilers and then maybe merge the outputs. None of these profilers is designed to work on long-running multi-threaded application. While implementing a game server, it turns out that is is impossible to profile an application retrieve the statistics then stop and then start later on on the fly(without affecting the profiled application). With the experience of implementing a game server in Python, we have identified most of the problems, tricky parts regarding profiler usage and so, we have come up with simple but powerful requirements.

Requirements:

  • Profiler should be started/stopped at any time from any thread in the application.
  • Profile statistics should be obtained from any thread at any time.
  • Profile events themselves should work theoretically in O(1) time and O(n+m) space(where m is recursion count) per any profile event. This means: application behavior/details/size should not affect the profiler run-time.
  • "Profiler pollution"(effect on the application run-time) should be very minimal and observable via statistics to see how much load the profiler is putting on the application. Best way to compute this pollution is to compute the percentage of total run time spent in profiler to the total application run-time.(these statistics shall also include space requirements per application)
  • Profiler shall handle the error/exception situations internally. For example running out of memory should be handled by the profiler itself. No OS/Python VM exception that occurred inside profiler shall not affect the profiled application.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.