Popular recipes tagged "profile" but not "performance"http://code.activestate.com/recipes/tags/profile-performance/2012-12-07T01:21:04-08:00ActiveState Code RecipesProfile Manager (Cave Story) (Python)
2012-12-07T01:21:04-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578368-profile-manager-cave-story/
<p style="color: grey">
Python
recipe 578368
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/manager/">manager</a>, <a href="/recipes/tags/profile/">profile</a>).
</p>
<p>If you have ever played a game that only had one save slot and wanted to be able to manage profiles, the following code written for Cave Story may be of use to you. The recipe provides a starting point for how one might go about writing a profile manager for such a program that runs through a command interface.</p>
Parse profile (Python)
2012-10-12T23:40:55-07:00Jason Friedmanhttp://code.activestate.com/recipes/users/4183835/http://code.activestate.com/recipes/578280-parse-profile/
<p style="color: grey">
Python
recipe 578280
by <a href="/recipes/users/4183835/">Jason Friedman</a>
(<a href="/recipes/tags/parse/">parse</a>, <a href="/recipes/tags/profile/">profile</a>, <a href="/recipes/tags/shell/">shell</a>).
Revision 3.
</p>
<pre class="prettyprint"><code>export VAR1=foo
export VAR2=bar
export VAR3=$VAR1$VAR2
export VAR4=${VAR1}$VAR2
export VAR5=${VAR1}indent
export VAR6="text${VAR1} " # With embedded spaces and a comment
export VAR7='${VAR4}' # Leave text within tics as-is
</code></pre>
<p>will be read as:</p>
<pre class="prettyprint"><code>{'VAR1': 'foo',
'VAR2': 'bar',
'VAR3': 'foobar',
'VAR4': 'foobar',
'VAR5': 'fooindent',
'VAR6': 'textfoo ',
'VAR7': '${VAR4}'}
</code></pre>
Profile decorator (Python)
2011-08-02T19:08:58-07:00Giampaolo RodolĂ http://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/577817-profile-decorator/
<p style="color: grey">
Python
recipe 577817
by <a href="/recipes/users/4178764/">Giampaolo RodolĂ </a>
(<a href="/recipes/tags/profile/">profile</a>, <a href="/recipes/tags/profiling/">profiling</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>A decorator for profiling a function which prints profiling results to stdout.
This was originally proposed as a patch for inclusion into python stdlib:</p>
<p><a href="http://bugs.python.org/issue9285" rel="nofollow">http://bugs.python.org/issue9285</a></p>
<p>Note that on certain Linux systems pstats module isn't available, despite it is supposed to be part of Python stdlib. On my Ubuntu box I had to run "sudo apt-get install python-profile" first.</p>