diff --git a/.changelog/185.doc b/.changelog/185.doc new file mode 100644 index 00000000..823bfebf --- /dev/null +++ b/.changelog/185.doc @@ -0,0 +1 @@ +Improved explanations in report of what it is that Fil tracks, and what a flamegraph tells you. \ No newline at end of file diff --git a/.changelog/291.doc b/.changelog/291.doc new file mode 100644 index 00000000..7943e841 --- /dev/null +++ b/.changelog/291.doc @@ -0,0 +1 @@ +Fix bad command name in the API documentation, thanks to @kdebrab. \ No newline at end of file diff --git a/.changelog/292.misc b/.changelog/292.misc new file mode 100644 index 00000000..e69de29b diff --git a/.changelog/298.feature b/.changelog/298.feature new file mode 100644 index 00000000..894c32cf --- /dev/null +++ b/.changelog/298.feature @@ -0,0 +1 @@ +Reports now have a "open in new tab" button. Thanks to @petergaultney for the suggestion. \ No newline at end of file diff --git a/docs/src/fil/api.md b/docs/src/fil/api.md index 7bd37751..c12b6a91 100644 --- a/docs/src/fil/api.md +++ b/docs/src/fil/api.md @@ -59,10 +59,10 @@ $ python yourscript.py --config=myconfig Now you would do: ```console -$ filprofiler python yourscript.py --config=myconfig +$ fil-profile python yourscript.py --config=myconfig ``` -Notice that you're doing `filprofiler `**`python`**, rather than `filprofiler run` as you would if you were profiling the full script. +Notice that you're doing `fil-profile `**`python`**, rather than `fil-profile run` as you would if you were profiling the full script. Only functions running for the duration of the `filprofiler.api.profile()` call will have memory profiling enabled, including of course the function you pass in. The rest of the code will run at (close) to normal speed and configuration. diff --git a/filprofiler/_report.py b/filprofiler/_report.py index bcf76a72..83694246 100644 --- a/filprofiler/_report.py +++ b/filprofiler/_report.py @@ -40,7 +40,7 @@ def render_report(output_path: str, now: datetime) -> str: margin: 4rem auto; font-size: 18px; }} - blockquote {{ border: 1px; border-color: black; }} + blockquote {{ border-width: 1px; border-color: black; border-style: solid; padding: 1em; }} div {{ text-align: center; }} @@ -74,42 +74,66 @@ def render_report(output_path: str, now: datetime) -> str:
{argv}
Need help, or does something look wrong? Read the documentation, and if that doesn't help please file an issue and I'll try to help.-
Want memory and performance profiling for your production batch jobs? -I'm working on a -always-on profiler called Fil4prod that is fast and robust enough to run in production; -send me an email to participate -in the alpha program.+I've also created an +always-on profiler called Sciagraph that is fast and robust enough to run in production.
Need help reducing your data processing application's memory use? Check out tips and tricks here.
+The flame graphs shows the callstacks responsible for allocations at peak.
The wider (and the redder) the bar, the more memory was allocated by that function or its callers. If the bar is 100% of width, that's all the allocated memory.
+The left-right axis has no meaning! +The order of frames is somewhat arbitrary, for example beause multiple calls to the same function may well have been merged into a single callstack. +So you can't tell from the graph which allocations happened first. +All you're getting is that at peak allocation these time, these stacktraces were responsible for these allocations. +
+The first graph shows the normal callgraph: if main() calls g() calls f(), let's say, then main() will be at the top. The second graph shows the reverse callgraph, from f() upwards.
Why is the second graph useful? If f() is called from multiple places, in the first graph it will show up multiple times, at the bottom. In the second reversed graph all calls to f() will be merged together.
-Need help reducing your data processing application's memory use? Check out tips and tricks here.
+Fil measures how much memory has been allocated; this is not the same as how much memory the process is actively using, nor is it the same as memory resident in RAM.
+ +See this article for more details.
+