Sophie

Sophie

distrib > Fedora > 20 > x86_64 > by-pkgid > d9f573299e87e886807be879704f0b6e > files > 158

julia-doc-0.3.4-1.fc20.noarch.rpm




<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Profiling &mdash; Julia Language 0.3.4 documentation</title>
  

  
  

  
  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>

  
  
    

  

  
  
    <link rel="stylesheet" href="../_static/julia.css" type="text/css" />
  

  
    <link rel="stylesheet" href="../_static/julia.css" type="text/css" />
  
    <link rel="top" title="Julia Language 0.3.4 documentation" href="../index.html"/>
        <link rel="next" title="Documentation of Julia’s Internals" href="../devdocs/julia.html"/>
        <link rel="prev" title="Unit and Functional Testing" href="test.html"/> 

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-nav-search">
        <a href="http://julialang.org/"><img src="../_static/julia-logo.svg" class="logo"></a>
        <!--
        <a href="../index.html" class="fa fa-home"> Julia Language</a>
        -->
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
        
        
            <ul>
<li class="toctree-l1"><a class="reference internal" href="../manual/introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../manual/getting-started.html">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/getting-started.html#resources">Resources</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/variables.html">Variables</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/variables.html#allowed-variable-names">Allowed Variable Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/variables.html#stylistic-conventions">Stylistic Conventions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/integers-and-floating-point-numbers.html">Integers and Floating-Point Numbers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/integers-and-floating-point-numbers.html#integers">Integers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/integers-and-floating-point-numbers.html#floating-point-numbers">Floating-Point Numbers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/integers-and-floating-point-numbers.html#arbitrary-precision-arithmetic">Arbitrary Precision Arithmetic</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/integers-and-floating-point-numbers.html#numeric-literal-coefficients">Numeric Literal Coefficients</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/integers-and-floating-point-numbers.html#literal-zero-and-one">Literal zero and one</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/mathematical-operations.html">Mathematical Operations and Elementary Functions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/mathematical-operations.html#arithmetic-operators">Arithmetic Operators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/mathematical-operations.html#bitwise-operators">Bitwise Operators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/mathematical-operations.html#updating-operators">Updating operators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/mathematical-operations.html#numeric-comparisons">Numeric Comparisons</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/mathematical-operations.html#elementary-functions">Elementary Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/complex-and-rational-numbers.html">Complex and Rational Numbers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/complex-and-rational-numbers.html#complex-numbers">Complex Numbers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/complex-and-rational-numbers.html#rational-numbers">Rational Numbers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/strings.html">Strings</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#characters">Characters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#string-basics">String Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#unicode-and-utf-8">Unicode and UTF-8</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#interpolation">Interpolation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#common-operations">Common Operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#non-standard-string-literals">Non-Standard String Literals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#regular-expressions">Regular Expressions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#id3">Byte Array Literals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/strings.html#version-number-literals">Version Number Literals</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/functions.html">Functions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#argument-passing-behavior">Argument Passing Behavior</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#the-return-keyword">The <tt class="docutils literal"><span class="pre">return</span></tt> Keyword</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#id1">Operators Are Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#operators-with-special-names">Operators With Special Names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#anonymous-functions">Anonymous Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#multiple-return-values">Multiple Return Values</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#varargs-functions">Varargs Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#optional-arguments">Optional Arguments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#keyword-arguments">Keyword Arguments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#evaluation-scope-of-default-values">Evaluation Scope of Default Values</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#block-syntax-for-function-arguments">Block Syntax for Function Arguments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/functions.html#further-reading">Further Reading</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/control-flow.html">Control Flow</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/control-flow.html#compound-expressions">Compound Expressions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/control-flow.html#conditional-evaluation">Conditional Evaluation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/control-flow.html#short-circuit-evaluation">Short-Circuit Evaluation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/control-flow.html#repeated-evaluation-loops">Repeated Evaluation: Loops</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/control-flow.html#exception-handling">Exception Handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/control-flow.html#tasks-aka-coroutines">Tasks (aka Coroutines)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/variables-and-scoping.html">Scope of Variables</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/variables-and-scoping.html#for-loops-and-comprehensions">For Loops and Comprehensions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/variables-and-scoping.html#constants">Constants</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/types.html">Types</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#type-declarations">Type Declarations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#abstract-types">Abstract Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#bits-types">Bits Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#composite-types">Composite Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#immutable-composite-types">Immutable Composite Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#declared-types">Declared Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#tuple-types">Tuple Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#type-unions">Type Unions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#man-parametric-types">Parametric Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#type-aliases">Type Aliases</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/types.html#operations-on-types">Operations on Types</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/methods.html">Methods</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/methods.html#defining-methods">Defining Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/methods.html#method-ambiguities">Method Ambiguities</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/methods.html#parametric-methods">Parametric Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/methods.html#note-on-optional-and-keyword-arguments">Note on Optional and keyword Arguments</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/constructors.html">Constructors</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/constructors.html#outer-constructor-methods">Outer Constructor Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/constructors.html#inner-constructor-methods">Inner Constructor Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/constructors.html#incomplete-initialization">Incomplete Initialization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/constructors.html#parametric-constructors">Parametric Constructors</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/constructors.html#case-study-rational">Case Study: Rational</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/conversion-and-promotion.html">Conversion and Promotion</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/conversion-and-promotion.html#conversion">Conversion</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/conversion-and-promotion.html#promotion">Promotion</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/modules.html">Modules</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/modules.html#summary-of-module-usage">Summary of module usage</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/metaprogramming.html">Metaprogramming</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/metaprogramming.html#expressions-and-eval">Expressions and Eval</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/metaprogramming.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/metaprogramming.html#reflection">Reflection</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/arrays.html">Multi-dimensional Arrays</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/arrays.html#arrays">Arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/arrays.html#sparse-matrices">Sparse Matrices</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/linear-algebra.html">Linear algebra</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/linear-algebra.html#matrix-factorizations">Matrix factorizations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/linear-algebra.html#special-matrices">Special matrices</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/networking-and-streams.html">Networking and Streams</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/networking-and-streams.html#basic-stream-i-o">Basic Stream I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/networking-and-streams.html#text-i-o">Text I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/networking-and-streams.html#working-with-files">Working with Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/networking-and-streams.html#a-simple-tcp-example">A simple TCP example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/networking-and-streams.html#resolving-ip-addresses">Resolving IP Addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/parallel-computing.html">Parallel Computing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#data-movement">Data Movement</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#parallel-map-and-loops">Parallel Map and Loops</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#synchronization-with-remote-references">Synchronization With Remote References</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#scheduling">Scheduling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#distributed-arrays">Distributed Arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#constructing-distributed-arrays">Constructing Distributed Arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#distributed-array-operations">Distributed Array Operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#shared-arrays-experimental">Shared Arrays (Experimental)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/parallel-computing.html#clustermanagers">ClusterManagers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/running-external-programs.html">Running External Programs</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/running-external-programs.html#interpolation">Interpolation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/running-external-programs.html#quoting">Quoting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/running-external-programs.html#pipelines">Pipelines</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html">Calling C and Fortran Code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#mapping-c-types-to-julia">Mapping C Types to Julia</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#accessing-data-through-a-pointer">Accessing Data through a Pointer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#passing-pointers-for-modifying-inputs">Passing Pointers for Modifying Inputs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#garbage-collection-safety">Garbage Collection Safety</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#non-constant-function-specifications">Non-constant Function Specifications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#indirect-calls">Indirect Calls</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#calling-convention">Calling Convention</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#accessing-global-variables">Accessing Global Variables</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#passing-julia-callback-functions-to-c">Passing Julia Callback Functions to C</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#c">C++</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/calling-c-and-fortran-code.html#handling-platform-variations">Handling Platform Variations</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/interacting-with-julia.html">Interacting With Julia</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/interacting-with-julia.html#the-different-prompt-modes">The different prompt modes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/interacting-with-julia.html#key-bindings">Key bindings</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/embedding.html">Embedding Julia</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/embedding.html#high-level-embedding">High-Level Embedding</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/embedding.html#converting-types">Converting Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/embedding.html#calling-julia-functions">Calling Julia Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/embedding.html#memory-management">Memory Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/embedding.html#working-with-arrays">Working with Arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/embedding.html#exceptions">Exceptions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/packages.html">Packages</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#package-status">Package Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#adding-and-removing-packages">Adding and Removing Packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#installing-unregistered-packages">Installing Unregistered Packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#updating-packages">Updating Packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#checkout-pin-and-free">Checkout, Pin and Free</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/packages.html#package-development">Package Development</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#initial-setup">Initial Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#generating-a-new-package">Generating a New Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#making-your-package-available">Making Your Package Available</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#publishing-your-package">Publishing Your Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#tagging-package-versions">Tagging Package Versions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#fixing-package-requirements">Fixing Package Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/packages.html#man-package-requirements">Requirements Specification</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/performance-tips.html">Performance Tips</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#avoid-global-variables">Avoid global variables</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#measure-performance-with-time-and-pay-attention-to-memory-allocation">Measure performance with <tt class="docutils literal"><span class="pre">&#64;time</span></tt> and pay attention to memory allocation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#tools">Tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#avoid-containers-with-abstract-type-parameters">Avoid containers with abstract type parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#type-declarations">Type declarations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#break-functions-into-multiple-definitions">Break functions into multiple definitions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#write-type-stable-functions">Write &#8220;type-stable&#8221; functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#avoid-changing-the-type-of-a-variable">Avoid changing the type of a variable</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#separate-kernel-functions">Separate kernel functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#access-arrays-in-memory-order-along-columns">Access arrays in memory order, along columns</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#pre-allocating-outputs">Pre-allocating outputs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#avoid-string-interpolation-for-i-o">Avoid string interpolation for I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#fix-deprecation-warnings">Fix deprecation warnings</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#tweaks">Tweaks</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/performance-tips.html#performance-annotations">Performance Annotations</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/style-guide.html">Style Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#write-functions-not-just-scripts">Write functions, not just scripts</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#avoid-writing-overly-specific-types">Avoid writing overly-specific types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#handle-excess-argument-diversity-in-the-caller">Handle excess argument diversity in the caller</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#append-to-names-of-functions-that-modify-their-arguments">Append <cite>!</cite> to names of functions that modify their arguments</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#avoid-strange-type-unions">Avoid strange type Unions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#try-to-avoid-nullable-fields">Try to avoid nullable fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#avoid-elaborate-container-types">Avoid elaborate container types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#avoid-underscores-in-names">Avoid underscores in names</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-overuse-try-catch">Don&#8217;t overuse try-catch</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-parenthesize-conditions">Don&#8217;t parenthesize conditions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-overuse">Don&#8217;t overuse ...</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-use-unnecessary-static-parameters">Don&#8217;t use unnecessary static parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#avoid-confusion-about-whether-something-is-an-instance-or-a-type">Avoid confusion about whether something is an instance or a type</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-overuse-macros">Don&#8217;t overuse macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-expose-unsafe-operations-at-the-interface-level">Don&#8217;t expose unsafe operations at the interface level</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#don-t-overload-methods-of-base-container-types">Don&#8217;t overload methods of base container types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#be-careful-with-type-equality">Be careful with type equality</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/style-guide.html#do-not-write-x-f-x">Do not write <tt class="docutils literal"><span class="pre">x-&gt;f(x)</span></tt></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/faq.html">Frequently Asked Questions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/faq.html#sessions-and-the-repl">Sessions and the REPL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/faq.html#functions">Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/faq.html#types-type-declarations-and-constructors">Types, type declarations, and constructors</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/faq.html#nothingness-and-missing-values">Nothingness and missing values</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/faq.html#julia-releases">Julia Releases</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/faq.html#developing-julia">Developing Julia</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../manual/noteworthy-differences.html">Noteworthy Differences from other Languages</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../manual/noteworthy-differences.html#noteworthy-differences-from-matlab">Noteworthy differences from MATLAB</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/noteworthy-differences.html#noteworthy-differences-from-r">Noteworthy differences from R</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manual/noteworthy-differences.html#noteworthy-differences-from-python">Noteworthy differences from Python</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="base.html">The Standard Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="base.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#getting-around">Getting Around</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#all-objects">All Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#types">Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#generic-functions">Generic Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#syntax">Syntax</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#iteration">Iteration</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#general-collections">General Collections</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#iterable-collections">Iterable Collections</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#indexable-collections">Indexable Collections</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#associative-collections">Associative Collections</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#set-like-collections">Set-Like Collections</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#dequeues">Dequeues</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#strings">Strings</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#i-o">I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#network-i-o">Network I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#text-i-o">Text I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#multimedia-i-o">Multimedia I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#memory-mapped-i-o">Memory-mapped I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#standard-numeric-types">Standard Numeric Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#mathematical-operators">Mathematical Operators</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#mathematical-functions">Mathematical Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#data-formats">Data Formats</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#numbers">Numbers</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#bigfloats">BigFloats</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#random-numbers">Random Numbers</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#arrays">Arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#combinatorics">Combinatorics</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#statistics">Statistics</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#signal-processing">Signal Processing</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#numerical-integration">Numerical Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#parallel-computing">Parallel Computing</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#distributed-arrays">Distributed Arrays</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#shared-arrays-experimental-unix-only-feature">Shared Arrays (Experimental, UNIX-only feature)</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#system">System</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#c-interface">C Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#errors">Errors</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#tasks">Tasks</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#events">Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#reflection">Reflection</a></li>
<li class="toctree-l2"><a class="reference internal" href="base.html#internals">Internals</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="sparse.html">Sparse Matrices</a></li>
<li class="toctree-l1"><a class="reference internal" href="linalg.html">Linear Algebra</a></li>
<li class="toctree-l1"><a class="reference internal" href="linalg.html#module-Base.LinAlg.BLAS">BLAS Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="constants.html">Constants</a></li>
<li class="toctree-l1"><a class="reference internal" href="file.html">Filesystem</a></li>
<li class="toctree-l1"><a class="reference internal" href="punctuation.html">Punctuation</a></li>
<li class="toctree-l1"><a class="reference internal" href="sort.html">Sorting and Related Functions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="sort.html#sorting-functions">Sorting Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="sort.html#order-related-functions">Order-Related Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="sort.html#sorting-algorithms">Sorting Algorithms</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pkg.html">Package Manager Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="collections.html">Collections and Data Structures</a><ul>
<li class="toctree-l2"><a class="reference internal" href="collections.html#priorityqueue">PriorityQueue</a></li>
<li class="toctree-l2"><a class="reference internal" href="collections.html#heap-functions">Heap Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="graphics.html">Graphics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="graphics.html#geometry">Geometry</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="test.html">Unit and Functional Testing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="test.html#overview">Overview</a></li>
<li class="toctree-l2"><a class="reference internal" href="test.html#handlers">Handlers</a></li>
<li class="toctree-l2"><a class="reference internal" href="test.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="test.html#functions">Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="test.html#testing-base-julia">Testing Base Julia</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Profiling</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#basic-usage">Basic usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="#accumulation-and-clearing">Accumulation and clearing</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options-for-controlling-the-display-of-profile-results">Options for controlling the display of profile results</a></li>
<li class="toctree-l2"><a class="reference internal" href="#configuration">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="#function-reference">Function reference</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../devdocs/julia.html">Documentation of Julia&#8217;s Internals</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../devdocs/cartesian.html">Base.Cartesian</a></li>
<li class="toctree-l2"><a class="reference internal" href="../devdocs/sysimg.html">System Image Building</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../devdocs/C.html">Developing/debugging Julia&#8217;s C code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../devdocs/backtraces.html">Reporting and analyzing crashes (segfaults)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../devdocs/debuggingtips.html">gdb debugging tips</a></li>
</ul>
</li>
</ul>

        
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../index.html">Julia Language</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../index.html">Docs</a> &raquo;</li>
      
    <li>Profiling</li>
      <li class="wy-breadcrumbs-aside">
        
          <a href="../_sources/stdlib/profile.txt" rel="nofollow"> View page source</a>
        
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document">
            
  <span class="target" id="module-Base.Profile"></span><div class="section" id="profiling">
<span id="stdlib-profiling"></span><h1>Profiling<a class="headerlink" href="#profiling" title="Permalink to this headline">¶</a></h1>
<p>The <tt class="docutils literal"><span class="pre">Profile</span></tt> module provides tools to help developers improve the
performance of their code. When used, it takes measurements on running
code, and produces output that helps you understand how much time is
spent on individual line(s).  The most common usage is to identify
&#8220;bottlenecks&#8221; as targets for optimization.</p>
<p><tt class="docutils literal"><span class="pre">Profile</span></tt> implements what is known as a &#8220;sampling&#8221; or <a class="reference external" href="http://en.wikipedia.org/wiki/Profiling_(computer_programming)">statistical
profiler</a>.  It
works by periodically taking a backtrace during the execution of any
task. Each backtrace captures the currently-running function and
line number, plus the complete chain of function calls that led to
this line, and hence is a &#8220;snapshot&#8221; of the current state of
execution.</p>
<p>If much of your run time is spent executing a particular line of code,
this line will show up frequently in the set of all backtraces.  In
other words, the &#8220;cost&#8221; of a given line&#8212;or really, the cost of the
sequence of function calls up to and including this line&#8212;is
proportional to how often it appears in the set of all backtraces.</p>
<p>A sampling profiler does not provide complete line-by-line coverage,
because the backtraces occur at intervals (by default, 1 ms on Unix
systems and 10 ms on Windows, although the actual scheduling is
subject to operating system load). Moreover, as discussed further
below, because samples are collected at a sparse subset of all
execution points, the data collected by a sampling profiler is subject
to statistical noise.</p>
<p>Despite these limitations, sampling profilers have substantial strengths:</p>
<ul class="simple">
<li>You do not have to make any modifications to your code to take
timing measurements (in contrast to the alternative <a class="reference external" href="https://github.com/timholy/IProfile.jl">instrumenting
profiler</a>).</li>
<li>It can profile into Julia&#8217;s core code and even (optionally) into C
and Fortran libraries.</li>
<li>By running &#8220;infrequently&#8221; there is very little performance overhead;
while profiling, your code can run at nearly native speed.</li>
</ul>
<p>For these reasons, it&#8217;s recommended that you try using the built-in
sampling profiler before considering any alternatives.</p>
<div class="section" id="basic-usage">
<h2>Basic usage<a class="headerlink" href="#basic-usage" title="Permalink to this headline">¶</a></h2>
<p>Let&#8217;s work with a simple test case:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="k">function</span><span class="nf"> myfunc</span><span class="p">()</span>
    <span class="n">A</span> <span class="o">=</span> <span class="n">rand</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">200</span><span class="p">)</span>
    <span class="n">maximum</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="k">end</span>
</pre></div>
</div>
<p>It&#8217;s a good idea to first run the code you intend to profile at least
once (unless you want to profile Julia&#8217;s JIT-compiler):</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">julia</span><span class="o">&gt;</span> <span class="n">myfunc</span><span class="p">()</span>  <span class="c"># run once to force compilation</span>
</pre></div>
</div>
<p>Now we&#8217;re ready to profile this function:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">julia</span><span class="o">&gt;</span> <span class="p">@</span><span class="n">profile</span> <span class="n">myfunc</span><span class="p">()</span>
</pre></div>
</div>
<p>To see the profiling results, there is a <a class="reference external" href="https://github.com/timholy/ProfileView.jl">graphical browser</a> available, but here
we&#8217;ll use the text-based display that comes with the standard library:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">julia</span><span class="o">&gt;</span> <span class="n">Profile</span><span class="o">.</span><span class="n">print</span><span class="p">()</span>
      <span class="mi">23</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">_start</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">373</span>
        <span class="mi">23</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">run_repl</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">166</span>
           <span class="mi">23</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">eval_user_input</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">91</span>
              <span class="mi">23</span> <span class="n">profile</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">anonymous</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">14</span>
                 <span class="mi">8</span>  <span class="n">none</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">2</span>
                  <span class="mi">8</span> <span class="n">dSFMT</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">dsfmt_gv_fill_array_close_open</span><span class="o">!</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">128</span>
                 <span class="mi">15</span> <span class="n">none</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">3</span>
                  <span class="mi">2</span>  <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">max</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">35</span>
                  <span class="mi">2</span>  <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">max</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">36</span>
                  <span class="mi">11</span> <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">max</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">37</span>
</pre></div>
</div>
<p>Each line of this display represents a particular spot (line number)
in the code.  Indentation is used to indicate the nested sequence of
function calls, with more-indented lines being deeper in the sequence
of calls.  In each line, the first &#8220;field&#8221; indicates the number of
backtraces (samples) taken <em>at this line or in any functions executed
by this line</em>. The second field is the file name, followed by a
semicolon; the third is the function name followed by a semicolon, and
the fourth is the line number.  Note that the specific line numbers
may change as Julia&#8217;s code changes; if you want to follow along, it&#8217;s
best to run this example yourself.</p>
<p>In this example, we can see that the top level is <tt class="docutils literal"><span class="pre">client.jl</span></tt>&#8216;s
<tt class="docutils literal"><span class="pre">_start</span></tt> function. This is the first Julia function that gets called
when you launch julia.  If you examine line 373 of <tt class="docutils literal"><span class="pre">client.jl</span></tt>,
you&#8217;ll see that (at the time of this writing) it calls <tt class="docutils literal"><span class="pre">run_repl</span></tt>,
mentioned on the second line. This in turn calls <tt class="docutils literal"><span class="pre">eval_user_input</span></tt>.
These are the functions in <tt class="docutils literal"><span class="pre">client.jl</span></tt> that interpret what you type
at the REPL, and since we&#8217;re working interactively these functions
were invoked when we entered <tt class="docutils literal"><span class="pre">&#64;profile</span> <span class="pre">myfunc()</span></tt>.  The next line
reflects actions taken in the <tt class="docutils literal"><span class="pre">&#64;profile</span></tt> macro.</p>
<p>The first line shows that 23 backtraces were taken at line 373 of
<tt class="docutils literal"><span class="pre">client.jl</span></tt>, but it&#8217;s not that this line was &#8220;expensive&#8221; on its own:
the second line reveals that all 23 of these backtraces were actually
triggered inside its call to <tt class="docutils literal"><span class="pre">run_repl</span></tt>, and so on. To find out
which operations are actually taking the time, we need to look deeper
in the call chain.</p>
<p>The first &#8220;important&#8221; line in this output is this one:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="mi">8</span>  <span class="n">none</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">2</span>
</pre></div>
</div>
<p><tt class="docutils literal"><span class="pre">none</span></tt> refers to the fact that we defined <tt class="docutils literal"><span class="pre">myfunc</span></tt> in the REPL,
rather than putting it in a file; if we had used a file, this would
show the file name. Line 2 of <tt class="docutils literal"><span class="pre">myfunc()</span></tt> contains the call to
<tt class="docutils literal"><span class="pre">rand</span></tt>, and there were 8 (out of 23) backtraces that occurred at
this line. Below that, you can see a call to
<tt class="docutils literal"><span class="pre">dsfmt_gv_fill_array_close_open!</span></tt> inside <tt class="docutils literal"><span class="pre">dSFMT.jl</span></tt>. You might be surprised not to see the
<tt class="docutils literal"><span class="pre">rand</span></tt> function listed explicitly: that&#8217;s because <tt class="docutils literal"><span class="pre">rand</span></tt> is <em>inlined</em>,
and hence doesn&#8217;t appear in the backtraces.</p>
<p>A little further down, you see:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="mi">15</span> <span class="n">none</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">3</span>
</pre></div>
</div>
<p>Line 3 of <tt class="docutils literal"><span class="pre">myfunc</span></tt> contains the call to <tt class="docutils literal"><span class="pre">max</span></tt>, and there were 15
(out of 23) backtraces taken here. Below that, you can see the
specific places in <tt class="docutils literal"><span class="pre">base/reduce.jl</span></tt> that carry out the
time-consuming operations in the <tt class="docutils literal"><span class="pre">max</span></tt> function for this type of
input data.</p>
<p>Overall, we can tentatively conclude that finding the maximum element
is approximately twice as expensive as generating the random
numbers. We could increase our confidence in this result by collecting
more samples:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">julia</span><span class="o">&gt;</span> <span class="p">@</span><span class="n">profile</span> <span class="p">(</span><span class="k">for</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">:</span><span class="mi">100</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">();</span> <span class="k">end</span><span class="p">)</span>

<span class="n">julia</span><span class="o">&gt;</span> <span class="n">Profile</span><span class="o">.</span><span class="n">print</span><span class="p">()</span>
       <span class="mi">3121</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">_start</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">373</span>
        <span class="mi">3121</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">run_repl</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">166</span>
           <span class="mi">3121</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">eval_user_input</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">91</span>
              <span class="mi">3121</span> <span class="n">profile</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">anonymous</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">1</span>
                 <span class="mi">848</span>  <span class="n">none</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">2</span>
                  <span class="mi">842</span> <span class="n">dSFMT</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">dsfmt_gv_fill_array_close_open</span><span class="o">!</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">128</span>
                 <span class="mi">1510</span> <span class="n">none</span><span class="p">;</span> <span class="n">myfunc</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">3</span>
                  <span class="mi">74</span>   <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">max</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">35</span>
                  <span class="mi">122</span>  <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">max</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">36</span>
                  <span class="mi">1314</span> <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">max</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">37</span>
</pre></div>
</div>
<p>In general, if you have <tt class="docutils literal"><span class="pre">N</span></tt> samples collected at a line, you can
expect an uncertainty on the order of <tt class="docutils literal"><span class="pre">sqrt(N)</span></tt> (barring other
sources of noise, like how busy the computer is with other tasks). The
major exception to this rule is garbage-collection, which runs
infrequently but tends to be quite expensive. (Since julia&#8217;s garbage
collector is written in C, such events can be detected using the
<tt class="docutils literal"><span class="pre">C=true</span></tt> output mode described below, or by using <a class="reference external" href="https://github.com/timholy/ProfileView.jl">ProfileView</a>.)</p>
<p>This illustrates the default &#8220;tree&#8221; dump; an alternative is the &#8220;flat&#8221;
dump, which accumulates counts independent of their nesting:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">julia</span><span class="o">&gt;</span> <span class="n">Profile</span><span class="o">.</span><span class="n">print</span><span class="p">(</span><span class="n">format</span><span class="o">=</span><span class="p">:</span><span class="n">flat</span><span class="p">)</span>
 <span class="n">Count</span> <span class="n">File</span>         <span class="n">Function</span>                         <span class="n">Line</span>
  <span class="mi">3121</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span>    <span class="n">_start</span>                            <span class="mi">373</span>
  <span class="mi">3121</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span>    <span class="n">eval_user_input</span>                    <span class="mi">91</span>
  <span class="mi">3121</span> <span class="n">client</span><span class="o">.</span><span class="n">jl</span>    <span class="n">run_repl</span>                          <span class="mi">166</span>
   <span class="mi">842</span> <span class="n">dSFMT</span><span class="o">.</span><span class="n">jl</span>     <span class="n">dsfmt_gv_fill_array_close_open</span><span class="o">!</span>   <span class="mi">128</span>
   <span class="mi">848</span> <span class="n">none</span>         <span class="n">myfunc</span>                              <span class="mi">2</span>
  <span class="mi">1510</span> <span class="n">none</span>         <span class="n">myfunc</span>                              <span class="mi">3</span>
  <span class="mi">3121</span> <span class="n">profile</span><span class="o">.</span><span class="n">jl</span>   <span class="n">anonymous</span>                           <span class="mi">1</span>
    <span class="mi">74</span> <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span>    <span class="n">max</span>                                <span class="mi">35</span>
   <span class="mi">122</span> <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span>    <span class="n">max</span>                                <span class="mi">36</span>
  <span class="mi">1314</span> <span class="n">reduce</span><span class="o">.</span><span class="n">jl</span>    <span class="n">max</span>                                <span class="mi">37</span>
</pre></div>
</div>
<p>If your code has recursion, one potentially-confusing point is that a
line in a &#8220;child&#8221; function can accumulate more counts than there are
total backtraces. Consider the following function definitions:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">dumbsum</span><span class="p">(</span><span class="n">n</span><span class="p">::</span><span class="n">Integer</span><span class="p">)</span> <span class="o">=</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">?</span> <span class="mi">1</span> <span class="p">:</span> <span class="mi">1</span> <span class="o">+</span> <span class="n">dumbsum</span><span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="n">dumbsum3</span><span class="p">()</span> <span class="o">=</span> <span class="n">dumbsum</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
</pre></div>
</div>
<p>If you were to profile <tt class="docutils literal"><span class="pre">dumbsum3</span></tt>, and a backtrace was taken while it was executing <tt class="docutils literal"><span class="pre">dumbsum(1)</span></tt>, the backtrace would look like this:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">dumbsum3</span>
    <span class="n">dumbsum</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
        <span class="n">dumbsum</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
            <span class="n">dumbsum</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
<p>Consequently, this child function gets 3 counts, even though the
parent only gets one.  The &#8220;tree&#8221; representation makes this much
clearer, and for this reason (among others) is probably the most
useful way to view the results.</p>
</div>
<div class="section" id="accumulation-and-clearing">
<h2>Accumulation and clearing<a class="headerlink" href="#accumulation-and-clearing" title="Permalink to this headline">¶</a></h2>
<p>Results from <tt class="docutils literal"><span class="pre">&#64;profile</span></tt> accumulate in a buffer; if you run multiple
pieces of code under <tt class="docutils literal"><span class="pre">&#64;profile</span></tt>, then <tt class="docutils literal"><span class="pre">Profile.print()</span></tt> will show
you the combined results. This can be very useful, but sometimes you
want to start fresh; you can do so with <tt class="docutils literal"><span class="pre">Profile.clear()</span></tt>.</p>
</div>
<div class="section" id="options-for-controlling-the-display-of-profile-results">
<h2>Options for controlling the display of profile results<a class="headerlink" href="#options-for-controlling-the-display-of-profile-results" title="Permalink to this headline">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">Profile.print()</span></tt> has more options than we&#8217;ve described so far.
Let&#8217;s see the full declaration:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="k">function</span><span class="nf"> print</span><span class="p">(</span><span class="n">io</span><span class="p">::</span><span class="n">IO</span> <span class="o">=</span> <span class="n">STDOUT</span><span class="p">,</span> <span class="n">data</span> <span class="o">=</span> <span class="n">fetch</span><span class="p">();</span> <span class="n">format</span> <span class="o">=</span> <span class="p">:</span><span class="n">tree</span><span class="p">,</span> <span class="n">C</span> <span class="o">=</span> <span class="n">false</span><span class="p">,</span> <span class="n">combine</span> <span class="o">=</span> <span class="n">true</span><span class="p">,</span> <span class="n">cols</span> <span class="o">=</span> <span class="n">tty_cols</span><span class="p">())</span>
</pre></div>
</div>
<p>Let&#8217;s discuss these arguments in order:</p>
<ul>
<li><p class="first">The first argument allows you to save the results to a file, but the
default is to print to <tt class="docutils literal"><span class="pre">STDOUT</span></tt> (the console).</p>
</li>
<li><p class="first">The second argument contains the data you want to analyze; by
default that is obtained from <tt class="docutils literal"><span class="pre">Profile.fetch()</span></tt>, which pulls out
the backtraces from a pre-allocated buffer. For example, if you want
to profile the profiler, you could say:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">data</span> <span class="o">=</span> <span class="n">copy</span><span class="p">(</span><span class="n">Profile</span><span class="o">.</span><span class="n">fetch</span><span class="p">())</span>
<span class="n">Profile</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
<span class="p">@</span><span class="n">profile</span> <span class="n">Profile</span><span class="o">.</span><span class="n">print</span><span class="p">(</span><span class="n">STDOUT</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span> <span class="c"># Prints the previous results</span>
<span class="n">Profile</span><span class="o">.</span><span class="n">print</span><span class="p">()</span>                      <span class="c"># Prints results from Profile.print()</span>
</pre></div>
</div>
</li>
<li><p class="first">The first keyword argument, <tt class="docutils literal"><span class="pre">format</span></tt>, was introduced above. The
possible choices are <tt class="docutils literal"><span class="pre">:tree</span></tt> and <tt class="docutils literal"><span class="pre">:flat</span></tt>.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">C</span></tt>, if set to <tt class="docutils literal"><span class="pre">true</span></tt>, allows you to see even the calls to C
code.  Try running the introductory example with <tt class="docutils literal"><span class="pre">Profile.print(C</span> <span class="pre">=</span>
<span class="pre">true)</span></tt>. This can be extremely helpful in deciding whether it&#8217;s
Julia code or C code that is causing a bottleneck; setting
<tt class="docutils literal"><span class="pre">C=true</span></tt> also improves the interpretability of the nesting, at
the cost of longer profile dumps.</p>
</li>
<li><p class="first">Some lines of code contain multiple operations; for example, <tt class="docutils literal"><span class="pre">s</span> <span class="pre">+=</span>
<span class="pre">A[i]</span></tt> contains both an array reference (<tt class="docutils literal"><span class="pre">A[i]</span></tt>) and a sum
operation.  These correspond to different lines in the generated
machine code, and hence there may be two or more different addresses
captured during backtraces on this line.  <tt class="docutils literal"><span class="pre">combine=true</span></tt> lumps
them together, and is probably what you typically want, but you can
generate an output separately for each unique instruction pointer
with <tt class="docutils literal"><span class="pre">combine=false</span></tt>.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">cols</span></tt> allows you to control the number of columns that you are
willing to use for display.  When the text would be wider than the
display, you might see output like this:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="mi">33</span> <span class="n">inference</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">abstract_call</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">645</span>
  <span class="mi">33</span> <span class="n">inference</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">abstract_call</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">645</span>
    <span class="mi">33</span> <span class="o">...</span><span class="n">rence</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">abstract_call_gf</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">567</span>
       <span class="mi">33</span> <span class="o">...</span><span class="n">nce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">typeinf</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">1201</span>
     <span class="o">+</span><span class="mi">1</span> <span class="mi">5</span>  <span class="o">...</span><span class="n">nce</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="o">...</span><span class="n">t_interpret</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">900</span>
     <span class="o">+</span><span class="mi">3</span> <span class="mi">5</span> <span class="o">...</span><span class="n">ence</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">abstract_eval</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">758</span>
     <span class="o">+</span><span class="mi">4</span> <span class="mi">5</span> <span class="o">...</span><span class="n">ence</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="o">...</span><span class="n">ct_eval_call</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">733</span>
     <span class="o">+</span><span class="mi">6</span> <span class="mi">5</span> <span class="o">...</span><span class="n">ence</span><span class="o">.</span><span class="n">jl</span><span class="p">;</span> <span class="n">abstract_call</span><span class="p">;</span> <span class="n">line</span><span class="p">:</span> <span class="mi">645</span>
</pre></div>
</div>
<p>File/function names are sometimes truncated (with <tt class="docutils literal"><span class="pre">...</span></tt>),
and indentation is truncated with a <tt class="docutils literal"><span class="pre">+n</span></tt> at the beginning,
where <tt class="docutils literal"><span class="pre">n</span></tt> is the number of extra spaces that would have been
inserted, had there been room. If you want a complete profile
of deeply-nested code, often a good idea is to save to a file and
use a very wide <tt class="docutils literal"><span class="pre">cols</span></tt> setting:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">s</span> <span class="o">=</span> <span class="n">open</span><span class="p">(</span><span class="s">&quot;/tmp/prof.txt&quot;</span><span class="p">,</span><span class="s">&quot;w&quot;</span><span class="p">)</span>
<span class="n">Profile</span><span class="o">.</span><span class="n">print</span><span class="p">(</span><span class="n">s</span><span class="p">,</span><span class="n">cols</span> <span class="o">=</span> <span class="mi">500</span><span class="p">)</span>
<span class="n">close</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">&#64;profile</span></tt> just accumulates backtraces, and the analysis happens
when you call <tt class="docutils literal"><span class="pre">Profile.print()</span></tt>. For a long-running computation,
it&#8217;s entirely possible that the pre-allocated buffer for storing
backtraces will be filled. If that happens, the backtraces stop but
your computation continues. As a consequence, you may miss some
important profiling data (you will get a warning when that happens).</p>
<p>You can obtain and configure the relevant parameters this way:</p>
<div class="highlight-julia"><div class="highlight"><pre><span class="n">Profile</span><span class="o">.</span><span class="n">init</span><span class="p">()</span>            <span class="c"># returns the current settings</span>
<span class="n">Profile</span><span class="o">.</span><span class="n">init</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">delay</span><span class="p">)</span>
<span class="n">Profile</span><span class="o">.</span><span class="n">init</span><span class="p">(</span><span class="n">delay</span> <span class="o">=</span> <span class="mf">0.01</span><span class="p">)</span>
</pre></div>
</div>
<p><tt class="docutils literal"><span class="pre">n</span></tt> is the total number of instruction pointers you can store, with
a default value of <tt class="docutils literal"><span class="pre">10^6</span></tt>. If your typical backtrace is 20
instruction pointers, then you can collect 50000 backtraces, which
suggests a statistical uncertainty of less than 1%. This may be good
enough for most applications.</p>
<p>Consequently, you are more likely to need to modify <tt class="docutils literal"><span class="pre">delay</span></tt>,
expressed in seconds, which sets the amount of time that Julia gets
between snapshots to perform the requested computations. A very
long-running job might not need frequent backtraces. The default
setting is <tt class="docutils literal"><span class="pre">delay</span> <span class="pre">=</span> <span class="pre">0.001</span></tt>.  Of course, you can decrease the delay
as well as increase it; however, the overhead of profiling grows once
the delay becomes similar to the amount of time needed to take a
backtrace (~30 microseconds on the author&#8217;s laptop).</p>
</div>
<div class="section" id="function-reference">
<h2>Function reference<a class="headerlink" href="#function-reference" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="Base.&#64;profile">
<tt class="descname">&#64;profile</tt><big>(</big><big>)</big><a class="headerlink" href="#Base.@profile" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">&#64;profile</span> <span class="pre">&lt;expression&gt;</span></tt> runs your expression while taking
periodic backtraces.  These are appended to an internal buffer of
backtraces.</p>
</dd></dl>

<dl class="function">
<dt id="Base.Profile.clear">
<tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#Base.Profile.clear" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear any existing backtraces from the internal buffer.</p>
</dd></dl>

<dl class="function">
<dt id="Base.Profile.print">
<tt class="descname">print</tt><big>(</big><span class="optional">[</span><em>io::IO = STDOUT</em><span class="optional">]</span>, <em>[data::Vector]; format = :tree</em>, <em>C = false</em>, <em>combine = true</em>, <em>cols = tty_cols()</em><big>)</big><a class="headerlink" href="#Base.Profile.print" title="Permalink to this definition">¶</a></dt>
<dd><p>Prints profiling results to <tt class="docutils literal"><span class="pre">io</span></tt> (by default, <tt class="docutils literal"><span class="pre">STDOUT</span></tt>). If you
do not supply a <tt class="docutils literal"><span class="pre">data</span></tt> vector, the internal buffer of accumulated
backtraces will be used.  <tt class="docutils literal"><span class="pre">format</span></tt> can be <tt class="docutils literal"><span class="pre">:tree</span></tt> or
<tt class="docutils literal"><span class="pre">:flat</span></tt>. If <tt class="docutils literal"><span class="pre">C==true</span></tt>, backtraces from C and Fortran code are
shown. <tt class="docutils literal"><span class="pre">combine==true</span></tt> merges instruction pointers that
correspond to the same line of code.  <tt class="docutils literal"><span class="pre">cols</span></tt> controls the width
of the display.</p>
</dd></dl>

<dl class="function">
<dt>
<tt class="descname">print</tt><big>(</big><span class="optional">[</span><em>io::IO = STDOUT</em><span class="optional">]</span>, <em>data::Vector</em>, <em>lidict::Dict; format = :tree</em>, <em>combine = true</em>, <em>cols = tty_cols()</em><big>)</big></dt>
<dd><p>Prints profiling results to <tt class="docutils literal"><span class="pre">io</span></tt>. This variant is used to examine
results exported by a previous call to <tt class="docutils literal"><span class="pre">Profile.retrieve()</span></tt>.
Supply the vector <tt class="docutils literal"><span class="pre">data</span></tt> of backtraces and a dictionary
<tt class="docutils literal"><span class="pre">lidict</span></tt> of line information.</p>
</dd></dl>

<dl class="function">
<dt id="Base.Profile.init">
<tt class="descname">init</tt><big>(</big><em>; n::Integer</em>, <em>delay::Float64</em><big>)</big><a class="headerlink" href="#Base.Profile.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Configure the <tt class="docutils literal"><span class="pre">delay</span></tt> between backtraces (measured in seconds),
and the number <tt class="docutils literal"><span class="pre">n</span></tt> of instruction pointers that may be
stored. Each instruction pointer corresponds to a single line of
code; backtraces generally consist of a long list of instruction
pointers. Default settings can be obtained by calling this function
with no arguments, and each can be set independently using keywords
or in the order <tt class="docutils literal"><span class="pre">(n,</span> <span class="pre">delay)</span></tt>.</p>
</dd></dl>

<dl class="function">
<dt id="Base.Profile.fetch">
<tt class="descname">fetch</tt><big>(</big><big>)</big> &rarr; data<a class="headerlink" href="#Base.Profile.fetch" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a reference to the internal buffer of backtraces. Note that
subsequent operations, like <tt class="docutils literal"><span class="pre">Profile.clear()</span></tt>, can affect
<tt class="docutils literal"><span class="pre">data</span></tt> unless you first make a copy. Note that the values in
<tt class="docutils literal"><span class="pre">data</span></tt> have meaning only on this machine in the current session,
because it depends on the exact memory addresses used in
JIT-compiling. This function is primarily for internal use;
<tt class="docutils literal"><span class="pre">Profile.retrieve()</span></tt> may be a better choice for most users.</p>
</dd></dl>

<dl class="function">
<dt id="Base.Profile.retrieve">
<tt class="descname">retrieve</tt><big>(</big><big>)</big> &rarr; data, lidict<a class="headerlink" href="#Base.Profile.retrieve" title="Permalink to this definition">¶</a></dt>
<dd><p>&#8220;Exports&#8221; profiling results in a portable format, returning the set
of all backtraces (<tt class="docutils literal"><span class="pre">data</span></tt>) and a dictionary that maps the
(session-specific) instruction pointers in <tt class="docutils literal"><span class="pre">data</span></tt> to <tt class="docutils literal"><span class="pre">LineInfo</span></tt>
values that store the file name, function name, and line
number. This function allows you to save profiling results for
future analysis.</p>
</dd></dl>

</div>
</div>


          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../devdocs/julia.html" class="btn btn-neutral float-right" title="Documentation of Julia’s Internals"/>Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="test.html" class="btn btn-neutral" title="Unit and Functional Testing"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
    </p>
  </div>

  <a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>
</footer>
        </div>
      </div>

    </section>

  </div>
  

  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../',
            VERSION:'0.3.4',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true
        };
    </script>
      <script type="text/javascript" src="../_static/jquery.js"></script>
      <script type="text/javascript" src="../_static/underscore.js"></script>
      <script type="text/javascript" src="../_static/doctools.js"></script>
      <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  
  
    <script type="text/javascript" src="../_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>