julia> </code></pre><p>A second run of this command needs about 3.7 s which means the startup time (load and compilation time of the package and the libraries) has been reduced to about 6.3s.</p><p>Without a system image the first time execution of the script "simulate_simple.jl" on the same computer is about 22.5 seconds while the time for the second execution is the same (3.9s). So now about 15s of time are saved after each restart.</p><h2 id="Hints-for-Developers"><a class="docs-heading-anchor" href="#Hints-for-Developers">Hints for Developers</a><a id="Hints-for-Developers-1"></a><a class="docs-heading-anchor-permalink" href="#Hints-for-Developers" title="Permalink"></a></h2><h3 id="Coding-style"><a class="docs-heading-anchor" href="#Coding-style">Coding style</a><a id="Coding-style-1"></a><a class="docs-heading-anchor-permalink" href="#Coding-style" title="Permalink"></a></h3><ul><li><p>add the packages <code>TestEnv</code> and <code>Revise</code> to your global environment, not to any project</p></li><li><p>avoid hard-coded numeric values like <code>9.81</code> in the code, instead define a global constant <code>G_EARTH</code> or read this value from a configuration file</p></li><li><p>stick to a line length limit of 120 characters</p></li><li><p>try to avoid dot operators unless you have to. </p></li></ul><p>Bad: <code>norm1 .~ norm(segment)</code> Good: <code>norm1 ~ norm(segment)</code></p><ul><li>if you need to refer to the settings you can use <code>se()</code> which will load the settings of the active project. To define the active project use a line like <code>set = se("system_3l.yaml")</code> at the beginning of your program.</li><li>use the <code>\cdot</code> operator for the dot product for improved readability</li><li>use a space after a comma, e.g. <code>force_eqs[j, i]</code></li><li>enclose operators like <code>+</code> and <code>*</code> in single spaces, like <code>0.5 * (s.pos[s.i_C] + s.pos[s.i_D])</code>; exception: <code>mass_tether_particle[i-1]</code></li><li>try to align the equation signs for improved readability like this:</li></ul><pre><code class="language-julia hljs"> tether_rhs = [force_eqs[j, i].rhs for j in 1:3]
0 commit comments