File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,22 +131,16 @@ script with
131131
132132 mprof run --python <script>
133133
134- will record timestamps when entering/leaving the profiled function,
135- and plot them on the graph afterward.
136- An example output can be found
137- `here <https://github.com/scikit-learn/scikit-learn/pull/2248 >`_
134+ will record timestamps when entering/leaving the profiled function. Runnning
138135
139- It is also possible to timestamp a portion of code using a context
140- manager like this::
136+ mprof plot
141137
142- def my_func():
143- a = [1] * (10 ** 6)
144- with profile.timestamp("b_computation"):
145- b = [2] * (2 * 10 ** 7)
146- del b
147- return a
138+ afterward will plot the result, making plots (using matplotlib) similar to these:
139+
140+ .. image :: https://camo.githubusercontent.com/3a584c7cfbae38c9220a755aa21b5ef926c1031d/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313930383631382f3836313332302f63623865376337382d663563632d313165322d386531652d3539373237623636663462322e706e67
141+ :target: https://github.com/scikit-learn/scikit-learn/pull/2248
148142
149- the string provided in the call will be displayed in the plot.
143+ A discussion of these capabilities can be found ` here < http://fa.bianp.net/blog/2014/ plot-memory-usage-as-a-function-of-time/ >`_ .
150144
151145The available commands for `mprof ` are:
152146
Original file line number Diff line number Diff line change 33# .. we'll use this to pass it to the child script ..
44_CLEAN_GLOBALS = globals ().copy ()
55
6- __version__ = '0.32 '
6+ __version__ = '0.33 '
77
88_CMD_USAGE = "python -m memory_profiler script_file.py"
99
You can’t perform that action at this time.
0 commit comments