~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to system/doc/efficiency_guide/introduction.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE chapter SYSTEM "chapter.dtd">
 
3
 
 
4
<chapter>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>2001</year><year>2009</year>
 
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
 
9
    </copyright>
 
10
    <legalnotice>
 
11
      The contents of this file are subject to the Erlang Public License,
 
12
      Version 1.1, (the "License"); you may not use this file except in
 
13
      compliance with the License. You should have received a copy of the
 
14
      Erlang Public License along with this software. If not, it can be
 
15
      retrieved online at http://www.erlang.org/.
 
16
    
 
17
      Software distributed under the License is distributed on an "AS IS"
 
18
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
19
      the License for the specific language governing rights and limitations
 
20
      under the License.
 
21
    
 
22
    </legalnotice>
 
23
 
 
24
    <title>Introduction</title>
 
25
    <prepared>Bjorn Gustavsson</prepared>
 
26
    <docno></docno>
 
27
    <date>2007-11-21</date>
 
28
    <rev></rev>
 
29
    <file>introduction.xml</file>
 
30
  </header>
 
31
 
 
32
  <section>
 
33
    <title>Purpose</title>
 
34
 
 
35
    <quote><p>Premature optimization is the root of all evil. -- D.E. Knuth</p></quote>
 
36
 
 
37
    <p>Efficient code can be well-structured and clean code, based on
 
38
    on a sound overall architecture and sound algorithms.
 
39
    Efficient code can be highly implementation-code that bypasses
 
40
    documented interfaces and takes advantage of obscure quirks in
 
41
    the current implementation.</p>
 
42
    
 
43
    <p>Ideally, your code should only contain the first kind of efficient
 
44
    code. If that turns out to be too slow, you should profile the application
 
45
    to find out where the performance bottlenecks are and optimize only the
 
46
    bottlenecks. Other code should stay as clean as possible.</p>
 
47
 
 
48
    <p>Fortunately, compiler and run-time optimizations introduced in
 
49
    R12B makes it easier to write code that is both clean and
 
50
    efficient. For instance, the ugly workarounds needed in R11B and earlier
 
51
    releases to get the most speed out of binary pattern matching are
 
52
    no longer necessary. In fact, the ugly code is slower
 
53
    than the clean code (because the clean code has become faster, not
 
54
    because the uglier code has become slower).</p>
 
55
    
 
56
    <p>This Efficiency Guide cannot really learn you how to write efficient
 
57
    code. It can give you a few pointers about what to avoid and what to use,
 
58
    and some understanding of how certain language features are implemented.
 
59
    We have generally not included general tips about optimization that will
 
60
    work in any language, such as moving common calculations out of loops.</p>
 
61
  </section>
 
62
 
 
63
  <section>
 
64
    <title>Prerequisites</title>
 
65
    <p>It is assumed that the reader is familiar with the Erlang
 
66
      programming language and concepts of OTP.</p>
 
67
  </section>
 
68
</chapter>
 
69